Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming Assignment 3 For each of the programs assigned below, submit a copy of the source code (.c file) saved as an electronic attachment

C Programming Assignment 3
For each of the programs assigned below, submit a copy of the source code (.c file) saved as an electronic attachment to Assignment 3 located in Canvas under Assignments.
Notes:
Observe the usual guidelines regarding the initial comment section, indenting, and so on.
In if-else statements, indent statements to be executed for if or else conditions three to five spaces. Align else or else if with corresponding if.
Note on problem 1: Be sure to print the three random numbers.
1.Seed the random number generator with time and then generate 3 random numbers between 1 and 500. Write a program to determine and print the largest of the three numbers.
2. Write a program to read in x and y coordinates of a point in the Cartesian plan and then to print a message telling either an axis on which the point lies or the quadrant in which it is found.
In the program, prompt the user to enter the x and y coordinates as floating point numbers. Using selection structures determine the axis or quadrant (I, II, III, or IV based on a counterclockwise numbering) where the point is located. Find a way to do this program that uses if structures other than just simple if.
Print the result as shown in the sample lines of output below:
(-1.0, -2.5) is in quadrant III.
(0.0, 4.8) is on the y-axis.
3. Write a program to calculate a students grade based on three test scores. Prompt the user for three test scores, calculate the average, and then determine the grade using the algorithm below:
If the average score is 90% or more, the grade is A.
If the average score is 70% or more and less than 90%, check the third score. If the third score is more than 90%, the grade is A; otherwise the grade is B.
If the average score is 50% or more and less than 70%, check the average of the second and third scores. If the average of the two is greater than 70%, the grade is C; otherwise the grade is D.
If the average score is less than 50% then the grade is F.
Implement the algorithm using nested statements within a given range rather than merely using all simple if statements. Within the if structure, assign the grade to a character variable. Print the grade at the end of the program.

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

1. What might have led to the misinformation?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago