Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that accepts 3 pieces of data (ID Number, # of hours taken, and # of credit points earned) for a student and

Write a program that accepts 3 pieces of data (ID Number, # of hours taken, and # of credit points earned) for a student and computes and prints the students GPA. The data is to be entered from the keyboard, with each loop producing one line of the output below.

Note: No array is needed since we just want to print output not store the data. So, each pass of the loop allows the user to enter data for a student, then prints that students output line. In order to not have the lines that prompt the user for input to get mixed into the output shown below, you will need to write the output shown below to a text file and copy the lines in the text file to this turn in sheet as your program output.

The data should be stored in the following structure type:

struct StudentType

{

int idNum,

creditPts,

creditHours;

double gpa;

}

Use the data below and format your output to appear as shown, with an additional column for GPA. Output should show the GPA with 2 decimal places.

Note: GPA is calculated as Credit Points divided by Credit Hours

ID Credit Points Credit Hours

1086 37 12

1198 124 37

9872 124 40

1112 124 46

2348 125 50

5577 312 125

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago