Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the C Language Part 1: You can do A, B, and C in one program with multiple loops (not nested) or each one in

In the C Language

Part 1:

You can do A, B, and C in one program with multiple loops (not nested) or each one in a small program, it doesnt matter.

A. Create a loop that will output all the positive multiples of 9 that are less than 99.

9 18 27 36 45 .

B. Create a loop that will output all the positive numbers less than 200 that are evenly divisible by both 2 and 7.

14 28 42

C. Create a loop that will calculate the sum of the positive multiples of 8 that are between 100 and 500. Output the sum.

Part 2:

Youre the teacher now! You need to count how many passing grades are entered. We dont know how many grades there will be. Use a sentinel controlled while loop that will ask the user to enter student grades until a value of -1 is entered. Use a counter variable to count all the grades that are passing grades, where 70 is the minimum passing grade (I know, youre a tough grader!) If there are any grades that are out of the valid range (0 through 100), present an error message to the user, and do not count that grade as passing (or valid). We also would like to see what percentage of the valid grades are passing.

Create 3 test cases. Use this as one of them:

Grades Entered: Expected Results

45

90

70

87

123 That is not a valid grade!

100

-1 You entered 4 passing grades.

80.0% of the valid grades are passing.

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago