Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab3B: GPA calculator. Were getting more practice making a calculator! GPA is important. Its one of the many things employers look at when recruiting new

Lab3B: GPA calculator. Were getting more practice making a calculator! GPA is important. Its one of the many things employers look at when recruiting new candidates. You also need a GPA of at least 2.0 to graduate from KSU. GPA is measured by quality points using the following scale: A = 4 quality points B = 3 quality points C = 2 quality points D = 1 quality point F = 0 quality points Each course counts for a certain number of credit hours. For instance, most courses are 3 credit hours. This lab is a 1 credit hour course. Calculus counts 4 credit hours. To calculate the quality points for one course, multiply the number of hours of that course times the quality points you earn for that course. To calculate your GPA for the whole semester, you take the total number of quality points earned that semester and divide it by the total number of hours taken that semester. For this lab, write a program that reads from the user the number of hours and quality points earned for four courses then calculates the total hours, total quality points and GPA. You should only use floats as the data type for your variables. An example run is shown below. The user input is in bold. Sample run 1: Course 1 hours: 4 Grade for course 1: 4 Course 2 hours: 3 Grade for course 2: 3 Course 3 hours: 3 Grade for course 3: 4 Course 4 hours: 4 Grade for course 4: 4 Total hours is: 14 Total quality points is: 53 Your GPA for this semester is 3.78571

what if i have it like this:

how do i finish the rest in JAVA

import java.util.Scanner;

public class Main {

public static void main(String args[])

{

Scanner sc = new Scanner(System.in);

float hoursc1, hoursc2, hoursc3, hoursc4, gradec1, gradec2, gradec3, gradec4;

System.out.println("Course 1 hours: ");

hoursc1= sc.nextFloat();

System.out.println("Grade for course 1: ");

gradec1= sc.nextFloat();

System.out.println("Course 2 hours: ");

hoursc2= sc.nextFloat();

System.out.println("Grade for course 2: ");

gradec2= sc.nextFloat();

System.out.println("Course 3 hours: ");

hoursc3= sc.nextFloat();

System.out.println("Grade for course 3 ");

gradec3= sc.nextFloat();

System.out.println("Course 4 hours ");

hoursc4= sc.nextFloat();

System.out.println("Grade for course 4 ");

gradec4= sc.nextFloat();

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

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago