Question

In Java please with pseudocode :) Assignment3C:   I just didn’t wanna take it!   We have a very...

In Java please with pseudocode :)

Assignment3C:   I just didn’t wanna take it!   We have a very forgivingexam policy.  If you miss Test 1, Test 2 or Test 3 for any reason (receiving a 0), thatexam will be replaced by whatever grade you get on the final(which is comprehensive).  Of course, that’s a risky move (it’s better to take the exams than rely on the final), but it helps students when “life gets in the way.”  The finalexam also replaces your lowest test grade if the finalexam is higher.  Once the replacements have occurred, the overall score is calculated by taking the average of the quiz average, Test 1, Test 2, Test 3 and the FinalExam.  The FinalExam does not replace the quiz average if it is lower.

For this assignment, you’ll ask the user for a quiz average and grades for Test 1, Test 2, Test 3 and the FinalExam.  The program will output the overall numeric average according to the policy described above. Hint #1: read in the variables first, then replace zeroes.  Then, ask yourself, how do I know if Test 1 is the lowest of the tests?  

Sample Output #1:

Quiz average:

80

Test 1:

90

Test 2:

80

Test 3:

50

Finalexam:

85

Finalexam replaces Test 3.

Overall grade is a 84.

Sample Output #2:

Quiz average:

82

Test 1:

0

Test 2:

0

Test 3:

76

Finalexam:

83

Zero from Test 1 is replaced with a 83.

Zero from Test 2 is replaced with a 83.

Finalexam replaces Test 3.

Overall grade is a 82.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Pseudocode :

This program will calculate the final grade after taking input of the test marks and making required adjustments to them.

{

In the main function

take all marks in the quiz, the tests and the final test as input.

Check if any test mark is 0, and replace it with marks obtained in the final test. Print the changes.

Check if any of the test mark is less than the marks obtained in the final test. If yes, replace it with the marks in the final test. Print the changes.

Calculate the Final grade by taking the average of all the marks and print it.

Java Code :

import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args) {
  
Scanner input = new Scanner(System.in);
  
   System.out.print("Quiz average : ");
int t = input.nextInt();
System.out.print("Marks in Test 1 : ");
int t1 = input.nextInt();
System.out.print("\nMarks in Test 2 : ");
int t2 = input.nextInt();
System.out.print("\nMarks in Test 3 : ");
int t3 = input.nextInt();
System.out.print("\nMarks in Final Test : ");
int t4 = input.nextInt();
if(t1==0)
{
t1 = t4;
System.out.print("\nZero from Test 1 is replaced with a "+t1);
}
if(t2==0)
{
t2 = t4;
System.out.print("\nZero from Test 1 is replaced with a "+t2);
}
if(t3==0)
{
t3 = t4;
System.out.print("\nZero from Test 1 is replaced with a "+t3);
}
  
if(t1<t4)
{
t1 = t4;
System.out.print("\nFinalexam replaces Test 1.");
}
if(t2<t4)
{
t2 = t4;
System.out.print("\nFinalexam replaces Test 2.");
}
if(t3<t4)
{
t3 = t4;
System.out.print("\nFinalexam replaces Test 3.");
}
  
float avg = (t1+t2+t3+t4+t)/5;
  
System.out.print("\nOverall grade is a "+avg);

input.close();
}
}

10 11 12 13 15 : 17 ܝܟ } 1 import java.util.Scanner; 2. public class HelloWorld { 3 public static void main(String[] args) {

INPUT :

82 日 8 76 33

OUTPUT :

Quiz average : Marks in Test 1 : Marks in Test 2 : Marks in Test 3 : Marks in Final Exam : Zero from Test 1 is replaced with

Add a comment
Know the answer?
Add Answer to:
In Java please with pseudocode :) Assignment3C:   I just didn’t wanna take it!   We have a very...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use java (I already have some of the code just I'm not the best please help!)...

    Use java (I already have some of the code just I'm not the best please help!) Write a program that will ask the user to enter 5 quiz grades. Add each quiz grade to a double variable called quizTotals. Then, calculate the average of all 5 quiz grades, and store it in a double variable called quizAverage.. Display the following output to the user: Enter quiz grade #1: Enter quiz grade #2: Enter quiz grade #3: Enter quiz grade #4:...

  • I need help writing a pseudocode: JAVA Write a pseudocode algorithm that asks the user for...

    I need help writing a pseudocode: JAVA Write a pseudocode algorithm that asks the user for their grades in CSE 1321, along with their attendance, then calculates their final grade. Note, perfect attendance rounds up your final grade by 1.5 points – otherwise, it’s a fraction out of 30. The tests and quiz average are worth 20% each. Sample Output: Enter your grade for Test 1: 95 Enter your grade for Test 2: 85 Enter your grade for Test 3:...

  • Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical...

    Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical grade for a hypothetical course, and and trying to use a set of numerical grades with their corresponding letter grades to get a vlookup function to return the letter grade from the numerical grade. However the function for some reason only returns the lowest value out of the set grades, not the closest match. Projects Classwork Teamwork/Integrity 100 100 A+ 98 A+ 97 A...

  • Grading Policy In addition to three in-class tests and a final exam, the final grade will...

    Grading Policy In addition to three in-class tests and a final exam, the final grade will include assessment of homework, quiz projects/classroom activities, and classroom participation, according to the following weights 1. Homework and Worksheets 2. Three Tests 3. Final Exam 4. Quizzes and Class Participation/Classroom Citizenshi 1 5% 40% 25% 20% Total 100% Grad Ran 92 100 90-91 88-89 82-87 80-81 an 78 -79 70-77 68 -69 66 67 60- 65 Assignment Grading: Each written assignment, except the Final...

  • this is a java course class. Please, I need full an accurate answer. Labeled steps of...

    this is a java course class. Please, I need full an accurate answer. Labeled steps of the solution that comply in addition to the question's parts {A and B}, also comply with: (Create another file to test the class and output to the screen, not an output file) please, DO NOT COPY others' solutions. I need a real worked answer that works when I try it on my computer. Thanks in advance. Write the definition of the class Tests such...

  • PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS...

    PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS POSSIBLE THANK YOU I REALLY APPRECIATE IT FILE TEXT: Mary 80 90 75 90 85 Joe 80 65 80 80 80 Same program as Quiz #4, but this time it must be done with arrays: Write a program that calculates the average of 5 test scores for each student on the file. Function 1--write a function to read the student's name 5 test scores...

  • use  JOptionPane to display output Can someone please help write a program in Java using loops, not...

    use  JOptionPane to display output Can someone please help write a program in Java using loops, not HashMap Test 1 Grades After the class complete the first exam, I saved all of the grades in a text file called test1.txt. Your job is to do some analysis on the grades for me. Input: There will not be any input for this program. This is called a batch program because there will be no user interaction other than to run the program....

  • [15 marks] Suppose that students enrolled in one course are required to take four tests, and...

    [15 marks] Suppose that students enrolled in one course are required to take four tests, and each student’s final grade for this course is the average of his/her grades of these four tests. This question asks you to write a program that can be used to compute the lowest final grade, highest final grade and the average final grade. General Requirements: Use a5q1.c as the name of your C source code file. We will use the following command on bluenose...

  • Julie Rios has​ take-home pay of ​$1 comma 030 per month and a disability insurance policy...

    Julie Rios has​ take-home pay of ​$1 comma 030 per month and a disability insurance policy that replaces 60 percent of earnings after a​ 90-day (3-month) waiting period. She has accumulated 80 sick days at work. Julie was involved in an auto accident and was out of work for four months. How much income did she​ lose, and how much would be replaced by her disability​ policy? How else could she replace her lost​ earnings? If after four months Julie...

  • For the following task, I have written code in C and need help in determining the...

    For the following task, I have written code in C and need help in determining the cause(s) of a segmentation fault which occurs when run. **It prints the message on line 47 "printf("Reading the input file and writing data to output file simultaneously..."); then results in a segmentation fault (core dumped) I am using mobaXterm v11.0 (GNU nano 2.0.9) CSV (comma-separated values) is a popular file format to store tabular kind of data. Each record is in a separate line...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT