1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tom [10]
3 years ago
10

This assignment requires you to write a well documented Java program to calculate the total and average of three scores, the let

ter grade, and output the results. Your program must do the following:
Prompt and read the users first and last name
Prompt and read three integer scores
Calculate the total and average
Determine a letter grade based on the following grading scale - 90-100 A; 80-89.99 B; 70-79.99 C; below 70 F
Use the printf method to output the full name, the three scores, the total, average, and the letter grade, properly formatted and on separate lines.
Within the program include a pledge that this program is solely your work and the IDE used to create/test/execute the program. Please submit the source code/.java file to Blackboard. Attached is a quick reference for the printf method.
Computers and Technology
1 answer:
blsea [12.9K]3 years ago
3 0

Answer:

The solution is given in the explanation section

Don't forget to add the pledge before submitting it. Also, remember to state the IDE which you are familiar with, I have used the intellij IDEA

Follow through the comments for a detailed explanation of each step

Explanation:

/*This is a Java program to calculate the total and average of three scores, the letter grade, and output the results*/

// Importing the Scanner class to receive user input

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   //Make an object of the scaner class

   Scanner in = new Scanner(System.in);

   //Prompt and receive user first and last name;

   System.out.println("Please enter your first name");

   String First_name = in.next();

   System.out.println("Please enter your Last name");

   String Last_name = in.next();

   //Prompt and receive The three integer scores;

   System.out.println("Please enter score for course one");

   int courseOneScore = in.nextInt();

   System.out.println("Please enter score for course two");

   int courseTwoScore = in.nextInt();

   System.out.println("Please enter score for course three");

   int courseThreeScore = in.nextInt();

   //Calculating the total scores and average

   int totalScores = courseOneScore+courseTwoScore+courseThreeScore;

   double averageScore = totalScores/3;

   /*Use if..Else statements to Determine a letter grade based on the following grading scale - 90-100 A; 80-89.99 B; 70-79.99 C; below 70 F */

   char letterGrade;

   if(averageScore>=90){

     letterGrade = 'A';

   }

   else if(averageScore>=80 && averageScore<=89.99){

     letterGrade = 'B';

   }

     else if(averageScore>=70 && averageScore<=79.99){

     letterGrade = 'C';

   }

   else{

     letterGrade ='F';

   }

   //Printing out the required messages

   System.out.printf("Name:  %s %s\n", First_name, Last_name);

   System.out.printf("scores: %d %d %d:  \n", courseOneScore, courseTwoScore, courseThreeScore);

   System.out.printf("Total and Average Score is: %d %.2f:  \n", totalScores, averageScore);

   System.out.printf("Letter Grade: %C:  \n", letterGrade);

  // System.out.printf("Total: %-10.2f:  ", dblTotal);

 }

}

You might be interested in
If a database is not maintained or if incorrect data is entered into the database, serious problems can occur. What problems cou
Archy [21]

Database is maintained by keeping only relevant data and updating existing data in a timely manner.

This is achieved by issuing proper insert, update and delete operations.

Incorrect data leads to incomplete information. Databases which hold transaction details, any inaccuracies lead to misinformation to its users.

Both the above lead to serious issues in data maintenance and prove the database ineffective. This indicates manhandling of the database.

No maintenance

Database is maintained when only relevant information is present. Irrelevant information includes information like information of past students, old information of current students, etc.

For students who have completed their courses and left, the database should be updated by removing data of such students.

Also, for newly enrolled students, their enrolment should reflect in the official records.

In case of changes in any of the student information, timely update operations should be performed to keep only current data in the database.

All these operations should be done timely in order to avoid any discrepancies in the real data and updated data in the system.

Incorrect data

In situations where incorrect data is input in the student database, incorrect data will be recorded for that particular student. Incorrect data can be related to ssn, name, address, course details and fees payment.

In case of incorrect transaction details like fees payment, this incorrect data will reflect in the student record as well as will affect the overall earnings of the school.

For enrolled students, correct enrollment details regarding the course and classroom should be recorded. Any error in this data will cause the student inconvenience and the respective student will be at loss.

Also, taking advantage of this situation, any outsider acting as an enrolled student, can gain access to the school.

This leads to mismatch of information and can lead to fraud situations against the educational institute.

3 0
3 years ago
The icacls.exe command adds __________, which are visible by clicking the Advanced button in the folder Properties dialog box
ella [17]

Answer:

“special” permissions

The icacls.exe command adds “special” permissions, which are visible by clicking the Advanced button in the folder Properties dialog box

8 0
3 years ago
Which term describes an approach to security similar to defense in depth in that it supports multiple layers, but uses a differe
miss Akunina [59]

Answer:

The answer to this question is Diversity of Defense.

Explanation:

Diversity of defense:- It is an approach for security which supports multiple layers but the catch here is that at each layer a different mechanism of security is used or at most of the layers.The idea is that you do not need to have multiple layers of defense but different defenses also.  

So we conclude that the answer to this question is Diversity in Defense.

3 0
3 years ago
Block elements start a new line when rendering? (true or false)
bekas [8.4K]

Answer:true

Explanation:

3 0
3 years ago
Is a computer an input output or storage
Effectus [21]

Answer:

Explanation:

A computer is a machine that can be programmed to accept data (input), process it into useful information (output), and store it away (in a secondary storage device) for safekeeping or later reuse. The processing of input to output is directed by the software but performed by the hardware.

6 0
3 years ago
Other questions:
  • Students recently created a Gaming Club at their school. On Friday every week, students bring in their gaming consoles (Xbox, Pl
    7·2 answers
  • If you like to interact with the game’s environment rather than with its inhabitants, which Bartle player type would you conform
    12·2 answers
  • Any method of determining whether an event or object is older or younger than others
    13·2 answers
  • Explain one way world war ii?-era advances in computers
    11·1 answer
  • A. What sectors are used with Foo?
    8·1 answer
  • In the space provided, analyze the pros and cons of becoming a member of an artistic guild. Your answer should be at least 150 w
    12·1 answer
  • Is the practice of downloading and distributing copyrighted content digitally without permission??
    14·1 answer
  • Which statement best describes 'abstraction'? *
    5·1 answer
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • 1. State three types of web protocols​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!