19 With the following declaration: int [,] points = {{300, 100, 200, 400, 600}, {550, 700, 900, 200, 100}}; The statement points [0, 4] = points [0, 4-2]; will
Q: size) - accepts 3 int arrays and a size as arguments and displays their content. Example: 135…
A: program: #include <iostream> using namespace std; const int ROWS = 3;const int COLS =…
Q: A(n) _________ is automatically called when an object is created.
A: Given: A(n) _________ is automatically called when an object is created.
Q: int main ()( int number; cin >> number; FindNumber (number, 0, 8); return 0;
A: 1)number =7 highvalue=8 lowvalue=0 midvalue=4 now, midvalue<number so, first z will print then,
Q: void showValues(int a[4]), int cols = 5) { for (int roW = 1; row <= 4; row++) for (int col = 1; col…
A: Task :- Identify the errors in given piece of code.
Q: A student has established the following monthly budget:Housing 500.00Utilities 150.00Household…
A: Given: A student has established the following monthly budget:Housing 500.00Utilities…
Q: SnowMan. o Draw a snowman o Use this code to draw a circle void drawCircle(GL2 gl,float xPos,float…
A: A OpenGL is a Application Programming Interface. As OpenGL is platform independent, we need some way…
Q: Pseudocode for the student grade calculator program, please Create a program to enter grades and…
A: Given that, Create a program to enter grades and calculate averages and letter grades. Need a class…
Q: public Account(String name) - Constructor: create an account with the given name and initial balance…
A: In Java, classes are collections of variables and functions that operate on those variables. The…
Q: Write a statement that creates an array named motors that can hold 100 Engine objects.
A: Engine[] motors; motors = new Engine[100];
Q: In this problem you will calculate the area of a house and compare it with another house to see…
A:
Q: Please rewrite the code: Here is the code: class PidManager {// Declare the range of possible pid…
A: Solution class M extends Thread// class decleration anf thread extending {public void d()//…
Q: Carl] cars=new Car[(new Car)}; Is a valid statement for creating an Array of Car objects. Select…
A: The statement Car[] cars = new Car[]{new Car()}; is not a valid statement for creating an array of…
Q: max = value2; %3D int main () int max = 03; %3D maxValue (1, 2, тах); cout << "max is " << max <<…
A:
Q: When complete, the following program skeleton will search for the string “Windy” in the array place.…
A: Given: When complete, the following program skeleton will search for the string “Windy” in the array…
Q: Write a statement that declares a reference variable named monthlyPay for an array that can hold…
A: Statement declaring a reference variable An array is an object used to hold values of same data…
Q: Total Amount per Blood Type A: B: p500 O: AB: p703.5 Buy another blood? N Total Amount: p1203.5…
A: Answer: I have answered in C++ because here not specified any programming language. our guide is…
Q: The ByteBuffer class array method returns an array of bytes, which is used as the argument of the:…
A: given Data:- The ByteBuffer class array method returns an array of bytes, which is used as the…
Q: Write a definition statement for a character array large enough to hold any of the following strings:…
A: Given: Write a definition statement for a character array large enough to hold any of the following…
Q: Assume that class ArrayStack has been defined using the implementation in your textbook. Assume also…
A: Below are all the answers and explanation:
Q: d) public static String getMonthName(int month) { // return the month name for month // e.g. if…
A: Ans d: Code: public static String getMonthName(int month){ switch(month){ case 1:…
Q: Create class Employee. • Use static variable annualTaxRate to store the annual tax rate for all…
A: These programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: Design an application that declares an array of 20 AutomobileLoan objects. Prompt the user for data…
A: import java.util.*; class Main { public static void main(String[] args) { Scanner Sc = new…
Q: Java program Write an application for Limpopo's Car Care Shop that shows a user a list of available…
A: As per the requirement program has been developed. Algorithm: Step 1: Write the main() method Step…
Q: Write an application that stores at least five different college courses (such as CIS101), the time…
A: The java program will be designed as follows: Initialize the array of courses. Initialize the array…
Q: In C#, all arrays have a __________ that is set to the number of elements in the array. a. Limit…
A: Property setting the number of elements in array The size property is used to declare the number of…
Q: Java Programming Write an application in which the user can enter a date using digits and slashes…
A: Implement isValidDate method that accepts the month, day, and year as three parameters. It verifies…
Q: Write Declare statements for the following variables or constants, making use of the rules of PLI…
A: a) We can Declare PERCENT as follows: DCL PERCENT(1:8) FIXED (5,2) REAL DEC; Here, the parentheses…
Q: When you pass an array as an argument, what is passed into the parameter variable?
A: The answer of the above question is when we pass an array as an argument, a reference to the array…
Q: B) Create an application containing an array that stores 20 prices, ich as $2.34, $7.89, $1.34, and…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: QUESTION 21 Multiple Choice: Which java statement correctly declares an array variable ? Array] x =…
A: given data declare an array varriable
Q: Assign pizzasInStore's first element's caloriesInSlice with the value in pizzasInStore's second…
A: Algorithm Here, pizzasInStore's first element's caloriesInSlice is…
Q: Assuming that the Circle class is defined as in Listing 9.1, show the printout of the following…
A: Program approach:- Using the necessary header file. Using the standard namespace input/output.…
Q: Declare an array named temperatures that can hold 10 doubles.
A: The datatype is double[] The name is temperatures The size is 10 So, let's see the statement how we…
Q: def display (): print ("ITSE101") def displayNumber (n1, n2): if nl > n2: return nl + n2 else:…
A: I have provided the comments to the given code and output.
Q: WorkArea Results #include using namespace std; class Player { public: void setName (string a)…
A: Here we have a class callled Player having two instance variable name and score. Accessor and…
Q: Bonus Quesion 2: What the following code does? int * DataGroup = new int [100]; if (!DataGroup){ ...…
A: C++ programming language is an object-oriented programming language, that's used to build…
Q: Create a struct called Salesperson which contains (1) the salesperson's full name, (2) an array of 6…
A: Asked to program in C with following requirements, 1) want to get 6 salesperson name 2) for each…
Q: Design an application that declares an array of 10 StockTransactionobjects. Prompt the user for data…
A: Given : Design an application that declares an array of 10 StockTransactionobjects. Prompt the user…
Q: Complete the following program so it defines an array of 10 Yard objects. The program should use a…
A: Given: Complete the following program so it defines an array of 10 Yard objects. The program should…
Q: Declare an enumerated data type named Direction with enumerators for North, South, East, and West.
A: Enumerators: This is a programmer defined data type and the elements contained in it are also…
Q: briefly explain this code #include #include using namespace std; class bank_account { int acno;…
A: This is a bank Management system. Output of the Program:-
Q: The struct should include the following fields: name, which should point to a string elsewhere ssn,…
A: 1. Create struct Employee with given data member 2. Create global object of employee with brace…
Q: Assign pizzasInStore's first element's caloriesInSlice with the value in pizzasInStore's second…
A: Here, pizzasInStore's first element's caloriesInSlice is pizzasInStore.at(0).caloriesInSlice and…
Q: this code is right or not * Class car { Int modle; String name; Int price; Puplic: Car(int x, string…
A: false the code is wrong .
Q: C# Question Write a statement that declares an array of integers called lotteryPicks and assigns it…
A: C# Declaring array of integers Declaration statement: int[] lotteryPicks ; Array is reference type…
Q: Given the following struct: typedef struct { char surname[MAX], name[MAX]; int id; float avg; //…
A: Hi, i have implemented the mostFrequent(student_t s[],int n) and printStudents(student_t s[],int…
Q: Assume that class ArrayStack has been defined using the implementation in your textbook. Assume also…
A: First, we will write the rough code by inserting the three statements. First, we will insert 4,3,2.…
Step by step
Solved in 2 steps with 1 images
- Salary Calculator Create a program that computes the salary based on an employee's hourly wage and hours worked. Note that employees may work for fractions of an hour, e.g. 1 and a half hours (1.5 hours). Use the following formulas: Less than or equal to 40 hours worked hourly wage * hours worked Over 40, but less than or equal to 65 hours worked (hourly wage * 40) + (hours worked - 40) * (hourly wage * 1.5) Over 65 hours worked (hourly wage * 40) + (hourly wage * 1.5) * 25 + (hours worked - 65) * hourly wage * 2 Also make sure that the hourly wage and hours worked are positive. Otherwise, display the error message: "Invalid input". Please see the sample outputs below to guide the design of your program. main.cc file #include <iomanip> #include <iostream> int main() { // TODO: accept user input to store the hourly wage and hours worked. // Then, include the header file at the top of this file so you can // call your function that computes a…1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has treasures. The cave can be represented in a grid which has rows numbered from 1 to , and columns numbered from 1 to . For this problem, define (x,y ) as a tile that is in the the-x row and the y-row. There is a character in each tile, which indicates the type of that tile. Tiles can be floors, walls, or treasures which are represented respectively by the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can go through the floor tiles and treasures, but you can't get past the wall tiles.Initially, you are in a tile (??, Sy). You want to visit all the treasure squares, and retrieve the treasure. When you visit a treasure tile, the treasure is instantly retrieved, and the tile turns into a floor.In a move, if you are on a tile (?,y), then you can move to the right tile above (?-1,y), right (?,y + 1), down (? + 1, ), and left (?, 1) of the current tile. The tile you visit must…Determine whether each statement below is true or false. Assume no index is out of bounds. Write either "true" or "false" on each line. Note: The Math.random() method returns a pseudorandom double type number greater than or equal to 0.0 and less than 1.0. int[] a = new int[6]; int[] b = new int[6]; int[] c = a; c[0] = 3;
- 4.23 (Financial application: payroll) Write a program that reads the following information and prints a payroll statement: Employee’s name (e.g., Smith)Number of hours worked in a week (e.g., 10)Hourly pay rate (e.g., 9.75)Federal tax withholding rate (e.g., 20%)State tax withholding rate (e.g., 9%) A sample run is shown below:Enter employee's name: SmithEnter number of hours worked in a week: 10Enter hourly pay rate: 9.75Enter federal tax withholding rate: 0.20Enter state tax withholding rate: 0.09Employee Name: SmithHours Worked: 10.0Pay Rate: $9.75Gross Pay: $97.5Deductions:Federal Withholding (20.0%): $19.5State Withholding (9.0%): $8.77Total Deduction: $28.27Net Pay: $69.22 Requirement: Requirements: Input and output must match the format provided in the exercise sample runs Currency must be displayed properly: You must have a dollar sign ($) and 2 places after the decimal (dollars and cents) You must use printf rather than the goofy trick from earlier chapters Appropriate…Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…Time CalculatorWrite a program that asks the user to enter a number of seconds.-There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes and leftover seconds in that many seconds.-There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours, minutes, and leftover seconds in that many seconds.-There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86,400, the program should display the number of days, hours, minutes, and leftover seconds in that many seconds.
- T F You cannot initialize a named constant that is declared with the const modifier.write the psuedocode and drow the flowchart Create a program to enter grades and calculate averages and letter grades. Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of number of students in use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program Add comments and use proper indentation.Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…
- TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM. Write an application that prompts for and reads the numerator and denominator of a fraction as integers, then displays the decimal equivalent of the fraction. Hint: This requires casting from integer to double before dividing. Testing: Submit testing exhibits using the following inputs:0, 1 giving 0.0; 1, 2 giving 0.5; 3, 8 giving 0.375; 2, 3 giving 0.666...; 25, 7 giving 3.57128...Need help coding in Java Morgan’s Department Store distributes bonuses to its salespeople after the holiday rush. Table 9-6 shows the bonuses, which are based on full weeks worked during the season and the number of positive online customer reviews. Write a program that allows a user to continuously enter values for the number of weeks worked and the number of positive reviews received and displays the appropriate bonus until the user enter a sentinel value: 99.Coin Converter Lab Description Write a program that asks the user to enter an amount of money in the format of dollars and remaining cents. The program should calculate and print the minimum number of coins (quarters, dimes, nickels and pennies) that are equivalent to the given amount.Hint: In order to find the minimum number of coins, first find the maximum number of quarters that fit in the given amount of money, then find the maximum number of dimes that fit in the remaining amount, and so on. File Name coins.py Score There are five tests each worth 2 points For example, an execution should look like this:Please enter the amount of money to convert:# of dollars: 2# of cents: 37The coins are 9 quarters, 1 dimes, 0 nickels and 2 pennies python labs