Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with printf on java requested. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I get this java.util.MissingFormatArgumentException error. I'm not sure how to round the value if print f doesn't work

Help with printf on java requested.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I get this java.util.MissingFormatArgumentException error. I'm not sure how to round the value if print f doesn't work in this way.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SumofWeights2 = (Exam1Weight + Exam2Weight + FinalExamWeight + LabsWeight + ProjectsWeight + AttendanceWeight + QuizzesWeight); SumofWeightxScore = (Exam1Weight*Exam1Score + Exam2Weight*Exam2Score + FinalExamScore*FinalExamWeight + LabAvg*LabsWeight + ProjectAvg*ProjectsWeight + QuizAvg*QuizzesWeight + AttendanceAvg*AttendanceWeight); CurrentScore = (SumofWeightxScore/SumofWeights2); x = (HundredxFinalOverallScore - SumofWeightxScore); y = (100 - SumofWeights2); AvgToFinalLetterGrade = (x/y); System.out.printf("Current Grade Score:%1.2f " + CurrentScore); System.out.println();

-----------------------------------------------------------------------------------------------------------------------

ERROR CODE BELOW:

Current Grade Score:Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%1.2f' at java.util.Formatter.format(Unknown Source) at java.io.PrintStream.format(Unknown Source) at java.io.PrintStream.printf(Unknown Source) at GradeCalculator.main(GradeCalculator.java:251) -------> this is line: System.out.printf("Current Grade Score:%1.2f " + CurrentScore);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Help with printf on java requested....

Answered: 1 week ago