Concept explainers
Write a grading
- Two quizzes, each graded on the basis of 10 points, are given.
- One midterm exam and one final exam, each graded on the basis of 100 points, are given.
- The final exam counts for 50 percent of the grade, the midterm counts for 25 percent, and the two quizzes together count for a total of 25 percent. (Do not forget to normalize the quiz scores. They should be converted to percentages before they are averaged in.)
Any grade of 90 percent or more is an A, any grade between 80 and 89 percent is a B, any grade between 70 and 79 percent is a C, any grade between 60 and 69 percent is a D, and any grade below 60 percent is an F.
The program should read in the student’s scores and display the student’s record, which consists of two quiz scores, two exam scores, the student’s total score for the entire course, and the final letter grade. The total score is a number in the range 0 to 100, which represents the weighted average of the student’s work.
Define and use a class for the student record. The class have instance variable for the quizzes, midterm, final, total score for the course, and final letter grade. The class should have methods to compute the overall numeric grade and the final letter grade. These last two methods will be void methods that set the appropriate instance variables. Remember, one method can call another method. If you prefer, you can define a single method that sets both the overall numeric score and the final letter grade, bet if you do this, use a helping method. Your program should use all the methods described here. Your class should have a reasonable set of accessor and mutator methods, whether or not your program uses them. You may add other methods if you wish.
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Concepts Of Programming Languages
Starting Out with Programming Logic and Design (4th Edition)
Software Engineering (10th Edition)
Starting Out with C++: Early Objects (9th Edition)
- Write a program that uses switch statement to enter the grades A, B, C, D or F. Your program should print “Excellent Performance” on A, “Good Work” on B, “Passing Work” on C, “Unsatisfactory work” or “See your instructor” for D and F and a default that prints “Grade is not legal”arrow_forwardWrite a c++ program for a bank in your town that updates its customers’ accounts at the end of each month. The bank offers two types of accounts:savings and cheque. Every customer must maintain a minimum balance.Minimum balances for the accounts are: Savings : R 1000.00 Cheque: R 1500.00If a customer’s balance falls below the minimum balance, there is a service charge of R50.00 for savings accounts andR100.00 for cheque accounts. If the balance at the end of the month is at least the minimum balance, the clientreceives interest as follows: Savings accounts receive 4% interest on the balance. Cheque accounts with balances of up to R 5000.00 more than the minimum balance receive 3% interest;otherwise, accounts with balances more than R 5000.00 more than the minimum balance receive 5% interest.Write a c++ program that requests the user to enter a customer’s account number (int type), account type (char type - S for savings, C for checking) and current balance. The updated balance must…arrow_forwardI have an assignment that needs to be turn in before monday, here's the question: Two people play the game of Count 21 by taking turns entering a 1, 2, or 3, which is added to a running total. The player who adds the value that makes the total reach or exceed 21 loses the game. Create a game of Count 21 in which a player competes against the computer, and program a strategy that always allows the computer to win. On any turn, if the player enters a value other than 1, 2, or 3, force the player to reenter the value. Save the game as Count21.java. Here's the code that I'm working on: import java.util.Scanner;public class Count21 {public static void main(String[] args) {// Scanner object to get user inputScanner scanner = new Scanner(System.in);// Stores the running total. //Displays a welcome for the user public void promptEnterKey(){System.out.println("Welcome to Count21! \n");System.out.println("Press \"ENTER\" to continue...");Scanner scanner = new…arrow_forward
- Write a program that does temperature converter :\n", "- The user will enter if he wants the result in Celsius or in Fahrenheit. Use the input function to read this option. \n", "- Ask the user the value of the temperature he wants to convert. Use the input function to read this value and convert accordingly.\n", "- If the user wants the temperature in Fahrenheit compute: $ Fahrenheit = Celsius*5/9+32$.\n", "- If the user wants the Celsius compute as follows: $ C = (F-32)*5/9 $.\n"arrow_forwardwrite a c program Count Dracula buys blood from the public. But since he prefers certain types to others, he pays as follows: Type Rate/liter A P 3000.00 B P 1800.75 C (for AB) P 2880.25 O P 1500.00 Write a C program to input a client’s blood type and the volume (liter) of blood extracted. Output how much the client will be paid.arrow_forwardWrite a program that displays a clock to show the current time, as shown in Figure 9.27a. To obtain the current time, use the datetime class in Supplement II.B.arrow_forward
- Write a C program to calculate the shipping cost for an order based on the total weight of the items and the shipping method chosen by the customer. The store offers two shipping methods: standard and express. The shipping rates are as follows: Standard: $2.50 per pound Express: $5.00 per poundHowever, there are certain conditions that affect the shipping cost: If the total weight of the items is above 10 pounds, a discount of 10% is applied to the shipping cost. If the shipping method chosen is express and the total weight is above 20 pounds, an additional $10 discount is applied.Your program should prompt the user to enter the total weight of the items and the shipping method ('S' for standard or 'E' for express). Based on this input, the program should calculate and output the total shipping cost.arrow_forwardWrite a program that will figure out the required change for a purchase. Start by asking the user for the price of the product and the amount paid. (We are expecting that the user will give a larger value for the amount paid.) Read in each of these values as a double. Report back to the user the number of each denomination of change due. You are not just telling the user the amount of money he gets back. Hint: Working with integers is much easier. The modulo operator is your friend for this assignment. Also, note that pennies can be tricky due to the poor real number to binary conversions. (Remember that 1.00 could actually be stored as 0.9999999999997.) Do not include five-dollar bills, ten-dollar bills, etc. Only show coins and one-dollar bill amounts. Be sure to test multiple values. There is a test case below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output Example (User input is marked with >>>.…arrow_forwardModify the following program so that it will read in and average four exam scores rather than two: BR main bonus: .EQUATE 5 ;constant exam1: .EQUATE 4 ;local variable #2d exam2: .EQUATE 2 ;local variable #2d score: .EQUATE 0 ;local variable #2d main: SUBSP 6, i ;allocate #exam1 #exam2 #score DECI exam1, s ;cin >> exam1 DECI exam2, s ; >> exam2 LDWA exam1, s ;score = (exam1 ADDA exam2, s ; + exam2) ASRA ; / 2 ADDA bonus, i ; + bonus STWA score, s STRO msg, d ;cout << "score = " DECO score, s ; << score LDBA '\n', i ; << endl STBA 0xFC16, dADDSP 6,i ; ;deallocate #score #exam2 #exam1 STOP msg: .ASCII "score = \x00" .END please show the screen shot the code and outputarrow_forward
- C++ Write a program that simulates the minute-by-minute operation of a checkout line, such as one you might find in a retail store. Use the following parameters: Customers arrive at the checkout line and stand in line until the cashier is free. When they reach the front of the line, they occupy the cashier for some period of time (referred to as ServiceTime) measured in minutes. After the cashier is free, the next customer is served immediately. Customers arrive at the checkout line at ArrivalRate per minute. Use the function included below (customerArrived()) to return the number of customers arriving in a given minute, determined randomly. The line can only hold so many people, MaxLineSize, until new arriving customers get frustrated and leave the store without purchasing anything. The overall time of the simulation is SimulationTime, measured in minutes. The program should take 5 inputs (to be read from a text file named simtest.txt, one per line): SimulationName - a string…arrow_forwardWrite a C++ program to read details of invoices from a file and to output invoices which indicate the total cost of each item and the total cost of the invoice together with full details. Details of an invoice are: An invoice header with number of items on the invoice and the date of the invoice For each item, an item code (6 digits), a name, a quantity and a unit cost. Thus a typical set of lines in the file for invoices might be: 3 2/12/2017 134276 Framis-R 8 7.35 125790 Framis-L 12 15.76 100086 Aglet 395 0.112 1/23/2017 135876 Wrench 12 22.50 543287 Henway 4 19.25 The above indicates that there are three items on the first invoice and its date is 2/12/2017, the first item has an item code of 134276 is a Framis-R an order quantity of 8 and a unit price of $7.35. There are two items on the next invoice, etc. Write a C++ program to read the file (input.txt) with details of invoices and to output to a file an invoice which indicates the total cost of each item and the total…arrow_forward"Write a program that reads true positives and false positives for each model and prints \"Good model\" and the value of the precision if the precision is above 0.75 or \"Bad model\" and the value of the precision if the precision is below 75. Teste the two models with your program and determine which one (or both) are good or bad models."arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning