Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 Write a program that allows user to calculate a student GPA. First ask the user, how many subjects to be included. Use a

image text in transcribed

Question 2 Write a program that allows user to calculate a student GPA. First ask the user, how many subjects to be included. Use a for loop to capture the points and credit hour for each subject (Use 2 array structure, 1 for points, and the other for credit hour). You are then required to calculate and print the GPA for the mentioned number of subjects. The formula for GPA (example of 3 subjects) is as follows: (Points1 x CreditHourl) + (Points2 x CreditHour2) + (Points2 x CreditHour2) CreditHourl + CreditHourl + CreditHourl Example output is shown below, user inputs are highlighted and BOLD. How many subjects?: 3 Points for subject 1: 3.75 Credit Hour for subject 1: 4 Points for subject 2: 4.00 Credit Hour for subject 2: 3 Points for subject 3: 3.00 Credit Hour for subject 3: 3 GPA is 3.60 Press any key to continue

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions