April 12 Agenda ENGS116 Professor Donohue 1. For... Next loops (see notes from l
ID: 3708762 • Letter: A
Question
April 12 Agenda ENGS116 Professor Donohue 1. For... Next loops (see notes from last class) 2. Activity: THIS ACTIVITY NEEDS TO BE UPLOADED BEFORE NEXT MONDAY's CLASS as HW assignment Write a program that gives students their letter grade. The letter grade is based on the course numerical to letter chart below. a) Write a code that asks the user for their homework average and exam/quiz average. Then use a User Defined Function to calculate the course letter grade. The course grade comes from the flowing breakdown: Numerica Letter Grade Average 293 290 287 283 280 277 273 270 267 260 Homework 10% (input A) Exam/quiz average 45% (input B) Project 20% (assume 80%) (input C) Final Exam 25% (assume 80%) (input D) · b) Then write a whole different module/code doing the same but: Write a sub program that finds the course letter grade. C+ Nested DO Loops: Extra if we have time: a. Set up a spreadsheet like below. 3. C- D+ c60 Write 2 nested loops that read the number in the cell and assign a color to that cell. Start the code as follows: Count Y-1 Do Until Cells(1, County).Value CountX 1 Do while Cells(CountX,Count) ? "" Cells(Count, CountY).Interior.Colorindex Count X- Count X +1 Loop County CountY +1 Loop End Sub b. Cells(Countx.count).ValueExplanation / Answer
Question 1 has insufficient information
Solution for Question (2)
import java.util.Scanner;
public class GradeCalculate {
public static void main(String[] args) {
System.out.println("Grade Calculator : ");
Scanner sc = new Scanner(System.in);
System.out.println("Please enter your average homework Marks");
int homework_marks = sc.nextInt();
System.out.println("Please enter your average exam/quiz Marks");
int quiz_marks = sc.nextInt();
System.out.println("Please enter your average project Marks");
int project_marks = sc.nextInt();
System.out.println("Please enter your average final exam Marks");
int finalexam_marks = sc.nextInt();
float netMarks = (float) (homework_marks*(0.10) + quiz_marks*(0.45) + project_marks*(0.20) + finalexam_marks*(0.25));
System.out.println("netMarks : "+netMarks);
String grade = "";
if(netMarks<60) {
grade="F";
}else if(netMarks>=60 && netMarks <67) {
grade="D";
}else if(netMarks>=67 && netMarks <70) {
grade="D+";
}else if(netMarks>=70 && netMarks <73) {
grade="C-";
}else if(netMarks>=73 && netMarks <77) {
grade="C";
}else if(netMarks>=77 && netMarks <80) {
grade="C+";
}else if(netMarks>=80 && netMarks <83) {
grade="B-";
}
else if(netMarks>=83 && netMarks <87) {
grade="B";
}
else if(netMarks>=87 && netMarks <90) {
grade="B+";
}
else if(netMarks>=90 && netMarks <93) {
grade="A-";
}
else if(netMarks>=93) {
grade="A";
}
System.out.println("Your final grade is : " + grade );
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.