Starting Out with Java: Early Objects (6th Edition)
6th Edition
ISBN: 9780134462011
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
thumb_up100%
Chapter 7, Problem 5AW
In a program you need to store the identification numbers of ten employees (as int values) and their weekly gross pay (as double values).
- a. Define two arrays that may be used in parallel to store the 10 employee identification numbers and gross pay amounts.
- b. Write a loop that uses these arrays to print each of the employees’ identification number and weekly gross pay.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles).
A) Define two arrays that may be used in parallel to store the 10 employee identification numbers and 10 weekly gross pay amounts.B) Write a loop that uses these arrays to print each employee’s identification number and weekly gross pay.
Design a program that will use a pair of nested loop to read the company's sales amounts. The details are as follows:
-KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales for each quarter of the year, and display the result for all divisions. Use a two dimensional array that will have 3 rows and 4 columns and show how the data will be organized.
Please provide solution using Python. Thank you.
Programing in C
Write a program that calculates the average grade of a class.
1. You should ask the user how many students you have (you will use this number to set up the
length of your array of decimals).
2. Once you have your array, you will have to ask the user for all the grades (there should only
be one grade per student). Using a while loop.
3. While you are scanning the grades, you should check if the inputted grade is in the range 0.0
to 10.0 (inclusive). If the grade is not in this range, you should display a message to the user and
assign 0.0 to the grade.
4. Once your array is populated with all student's grades, print out the values of the array, so that
the user knows these values were saved correctly (use a while loop as well).
5. After this calculate the average (add up all grades and divide by the number of students).
Hint: You will need a loop to do so; please use a while loop as well.
Example:
How many students are in your class? 8
Please input the grades:
8.5
9.8…
Chapter 7 Solutions
Starting Out with Java: Early Objects (6th Edition)
Ch. 7.1 - Write statements that create the following arrays:...Ch. 7.1 - Whats wrong with the following array declarations?...Ch. 7.1 - Prob. 7.3CPCh. 7.1 - Prob. 7.4CPCh. 7.1 - Prob. 7.5CPCh. 7.1 - Prob. 7.6CPCh. 7.1 - Prob. 7.7CPCh. 7.1 - Prob. 7.8CPCh. 7.2 - Prob. 7.9CPCh. 7.2 - Prob. 7.10CP
Ch. 7.2 - A program has the following declaration: double[]...Ch. 7.2 - Look at the following statements: final in...Ch. 7.3 - Look at the following method header: public static...Ch. 7.3 - Write a method named zero, which accepts an int...Ch. 7.6 - Prob. 7.15CPCh. 7.7 - Recall that we discussed a Rectangle class in...Ch. 7.9 - What value in an array does the selection sort...Ch. 7.9 - How many times will the selection sort swap the...Ch. 7.9 - Prob. 7.19CPCh. 7.9 - Prob. 7.20CPCh. 7.9 - If a sequential search is performed on an array,...Ch. 7.11 - Prob. 7.22CPCh. 7.13 - What import statement must you include in your...Ch. 7.13 - Write a statement that creates an ArrayList object...Ch. 7.13 - Write a statement that creates an ArrayList object...Ch. 7.13 - Prob. 7.26CPCh. 7.13 - Prob. 7.27CPCh. 7.13 - Prob. 7.28CPCh. 7.13 - Prob. 7.29CPCh. 7.13 - Prob. 7.30CPCh. 7.13 - Prob. 7.31CPCh. 7 - Prob. 1MCCh. 7 - Prob. 2MCCh. 7 - Prob. 3MCCh. 7 - Prob. 4MCCh. 7 - Array bounds checking happens. a. when the program...Ch. 7 - Prob. 6MCCh. 7 - Prob. 7MCCh. 7 - Prob. 8MCCh. 7 - Prob. 9MCCh. 7 - Prob. 10MCCh. 7 - To store an item in an ArrayList object, use this...Ch. 7 - Prob. 12MCCh. 7 - To delete an item from an ArrayList object, you...Ch. 7 - Prob. 14TFCh. 7 - Prob. 15TFCh. 7 - Prob. 16TFCh. 7 - Prob. 17TFCh. 7 - Prob. 18TFCh. 7 - Prob. 19TFCh. 7 - True or False: The Java compiler does not display...Ch. 7 - Prob. 21TFCh. 7 - True or False: The first size declarator in the...Ch. 7 - Prob. 23TFCh. 7 - Prob. 24TFCh. 7 - int[] collection = new int[-20];Ch. 7 - Prob. 2FTECh. 7 - Prob. 3FTECh. 7 - Prob. 4FTECh. 7 - Prob. 5FTECh. 7 - Prob. 1AWCh. 7 - Prob. 2AWCh. 7 - Prob. 3AWCh. 7 - In a program you need to store the populations of...Ch. 7 - In a program you need to store the identification...Ch. 7 - Prob. 6AWCh. 7 - Prob. 7AWCh. 7 - Prob. 8AWCh. 7 - Prob. 9AWCh. 7 - Prob. 10AWCh. 7 - Prob. 11AWCh. 7 - Prob. 1SACh. 7 - Prob. 2SACh. 7 - Prob. 3SACh. 7 - Prob. 4SACh. 7 - Prob. 5SACh. 7 - The following statement creates an InventoryItem...Ch. 7 - Prob. 7SACh. 7 - Prob. 8SACh. 7 - Rainfall Class Write a RainFall class that stores...Ch. 7 - Payroll Class Write a Payroll class that uses the...Ch. 7 - Charge Account Validation Create a class with a...Ch. 7 - Prob. 4PCCh. 7 - Charge Account Modification Modify the charge...Ch. 7 - Drivers License Exam The local Drivers License...Ch. 7 - Magic 8 Ball Write a program that simulates a...Ch. 7 - Grade Book A teacher has five students who have...Ch. 7 - Grade Book Modification Modify the grade book...Ch. 7 - Average Steps Taken A Personal Fitness Tracker is...Ch. 7 - ArrayOperations Class Write a class name...Ch. 7 - 12.1994 Gas Prices In the student sample programs...Ch. 7 - Sorted List of 1994 Gas Prices Note: This...Ch. 7 - Name Search If you have downloaded this books...Ch. 7 - Population Data If you have downloaded this books...Ch. 7 - World Series Champions If you have downloaded this...Ch. 7 - Search Benchmarks Modify the sequentialSearch and...Ch. 7 - 2D Array Operations Write a program that creates a...Ch. 7 - Prob. 19PCCh. 7 - Trivia Game In this programming challenge, you...Ch. 7 - Prob. 21PC
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Given that y=ax3+7, which of the following are correct Java statements for this equations? int y = a x x (x +...
Java How To Program (Early Objects)
A file that contains a Flash animation uses the __________ file extension. a. .class b. .swf c. .mp3 d. .flash
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Number of Days Worked Design a class called NumDays. The classs purpose is to store a value that represents a n...
Starting Out with C++: Early Objects
What is the difference between the names defined in an ML let construct from the variables declared in a C bloc...
Concepts Of Programming Languages
What is the difference between operating system software and application software?
Starting Out With Visual Basic (7th Edition)
Ship. CruiseShip, and CargoShip Classes Design a Ship class that has the following members: A member variable ...
Starting Out with C++ from Control Structures to Objects (9th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Program thisarrow_forward2. you have data of size 499 byte stored in an array starting at 45000H, write a program to check the data if it is positive store it in memory location starting at 47000H, if it is negative change it into positive and store it in the same arrayarrow_forwardWrite a program that will read the monthly salary of 10 employees and then calculates the income tax (i.e, 10% of the salary) and net salary. Hence you have to declare an array salary[10][3]. Your program should have 4 functions. The first function will be used to read monthly salary of 10 employees and put it in the first column of the array. The second function will be used to calculate the income tax for each employee and then store it in the second column of the array. The third function will be used to calculate the net salary of each employee and store it in the third column of the array. Finally, the fourth function will be used to display the gross salary, income tax and net salary for each employee. You must pass the array as reference in each function you used.arrow_forward
- Using C++ Language Start with the provided code and understand what it is doing. We are interested in computing the maximum grade out of the 6 quiz scores for each student in class. Assume the maximum class size is 10, but we will ask the teacher how many students there are in the class. It cannot be more than 10. In the below program, we create a two-dimensional array with the number of rows equal to the number of students (one for each student) and 6 columns (one column for each quiz grade). code: #include <iostream>using namespace std;const int COLS = 6;const int ROWS = 10;void computeMaximum (float grades[][COLS], int num, float maximum[]);void showArray(float array[], int size);int main(){ float grades[ROWS][COLS]; float maximum[ROWS]; int num; cout<<"How many students in the class?"; cin>>num; for (int row = 0; row < num; row++) { //enters 6 quiz grades for each student for (int col = 0; row< COLS; col++)…arrow_forwardA local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3×7 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then it should create a report that includes the following information: Average amount of food eaten per day by the whole family of monkeys The least amount of food eaten during the week by any one monkey The greatest amount of food eaten during the week by any one monkeyarrow_forwardDesign a program that asks the user to enter a store’s sales for each day of a 7 day week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week, the average sales per day, and also display the list of values. This is for java.arrow_forward
- Q4. Write a program that creates an array of 100 random integers in the range 1 to 200 and then using sequential search searches the array 100 times using randomly generated targets in the same range. At the end of the program the following statistics to be displayed. (COO1) The number of searched completed. The number of successful searches. The percentage of successful searches. The average number of tests per search. Note : To determine the average test per search you will need to count the number of tests for each search. Hint : Use the comma operator to count the compares.arrow_forwardWrite a program that reads student scores into an array, gets the best score, and then assigns grades based on the following scheme: • Grade is A if score is • Grade is B if score is • Grade is C if score is • Grade is D if score is • Grade is F otherwise. best - 10 best - 20; best - 30; best - 40; The program prompts the user to enter the total number of students, then prompts the user to enter all of the scores, and concludes by displaying the gradesarrow_forwardWrite a program to help your instructor calculate the highest and the lowest grade in the final exam of his/her CSCI250 section. Your program should ask the instructor to enter the number of students and then the grade for every student. The grades should be stored in an array. Then the program should find and display the highest and the lowest grade in the array as shown the sample run below. Sample run 1: Enter the number of Students: 5 Enter grade for student 1: 80.5 Enter grade for student 2: 35 Enter grade for student 3: 75.5 Enter grade for student 4: 90 Enter grade for student 5: 63.4 The highest grade is 90 The lowest grade is 35.0 Sample run 2: Enter the number of Students: 3 Enter grade for student 1: 80 Enter grade for student 2: 60 Enter grade for student 3: 80 The highest grade is 80 The lowest grade is 60arrow_forward
- PLZ DO IT RIGHT OR I WILL DO DISLIKEarrow_forwardWrite a program that simulates rolling two dice. Prompt the user to enter the number of dice rolls. Use a loop to repeatedly call a method that simulates a dice roll and returns the total of the two dice to main. Keep track of the rolls in an array in main, and end the program by showing the results of the rolls.arrow_forwardUsing C++arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Program to find HCF & LCM of two numbers in C | #6 Coding Bytes; Author: FACE Prep;https://www.youtube.com/watch?v=mZA3cdalYN4;License: Standard YouTube License, CC-BY