Write a program calculates the average of the four grades

Assignment Help C/C++ Programming
Reference no: EM13969433

Part A

Explain the difference between:

s = 0;
If (x > 0) s++;
If (y > 0) s++;

and

s = 0;
if (x > 0) s++;
else if (y > 0) s++;

Part B

What are the values of s and n after the following loops?:

a. int s = 1;
int n = 1;
while (x < 10)
s = s + n;
n++;

b. int s = 1;
int n;
for (n = 1; n < 5; n++)
s = s + n;

c. int s = 1;
int n = 1;
do
{
s = s + n;
n++;
}
while (s < 10 * n);

Part C

Write a program that accepts four grades, calculates the average of the four grades, and then converts the average from a number grade into a letter grading using the following grading scale:

A 100 - 90
B 89 - 80
C 79 - 70
D 69 - 60
F 59 - 0

Output the final grade average along with the letter grade.

Reference no: EM13969433

Questions Cloud

Different types of legal proceedings : Identify the different types of legal proceedings which might arise from these facts. For each type of legal action you have identified in (a), discuss the nature of the legal liability and the purpose or objective of taking legal action.
What leadership qualities did the coaches demonstrate : What leadership qualities did the Coaches demonstrate to be able to bring the team together to win the championship?
Civil or criminal proceedings : Consider the following legal actions and indicate whether civil or criminal proceedings would result: (a) Ann decides to divorce her husband, Barry, after 10 years of marriage;
Indicate the type of sales promotion : Indicate the type of sales promotion that a producer might use in each of the following situations and briefly explain your reasons: (1) A firm has developed an improved razor blade, but customers are not motivated to buy it.
Write a program calculates the average of the four grades : Write a program that accepts four grades, calculates the average of the four grades, and then converts the average from a number grade into a letter grading using the following grading scale: Output the final grade average along with the letter gra..
How various elements of system support innovation at three-m : How has 3M built structural and contextual ambidexterity into the organization? How do the various elements of the system support innovation at 3M?
Identify the risks associated with the supplier expansion : Write a 1,050- to 1,400-word paper in which you do the following: Identify the risks associated with the supplier expansion. Document those risks in the Risk Project Log template. Perform a qualitative risk analysis using risk probability and impact ..
Aspects of the effectiveness of humor : Your paper should delineate three or more aspects of the effectiveness of humor and indicate at least three risks of attempting to use humor in persuasion. Your paper should include previous theories of persuasion and discuss how the technique of ..
Brief description of the malware and it capabilities : Visit the Museum, choose a malware from the collection and study it. Post a brief description of the Malware and it capabilities. Your post should be in your own words based on your understanding of the malware that you examined. Text-book style ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Why is programming is needed now-a-days

Why is programming is needed now-a-days. what is the benefit of colleges to apply heavy loads on students head.

  Macro definitions

Given the following macro definitions #define HEIGHT 3#define WIDTH 5 There is a multidimensional array called anArray declared as follows:

  What constructors do and when they are executed

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Show the orders that produce different values

Provide an example in C++ of an expression whose value depends upon the evaluation order - Show the orders that produce different values and the values they produce.

  Concept of object-oriented programming

Determine the manner in which each of the provided concepts relates to the concept of object-oriented programming. Justify your response - Analyze the fundamental manner in which they each relate to C++ coding of programs.

  Generate a random number

Generate a random number between 1 – 5 and 3 – 8 for express and normal lanes, respectively. This represents the arrival time of the first customer into each lane. Set the variable for total time elapsed to 0.

  Copy the sample program and compile

What does the following program do?. Copy the sample program and compile it, then find the results. Submit a report which is more than one page length to explain how the program works and how you can improve it

  Definition of the function template moventhfront

Write the definition of the function template moveNthFront that takes as a parameter a queue and a positive integer, n.

  Create a road class

Create a Road class. The class should have functions for setting the width of the road in feet and the length of the road in miles. It should also have functions for obtaining the width of the road the length of the road

  Write a program that allows two players to play a game

Write a program that allows two players (player X and player O) to play a game of tic-tac-toe. Use a two- dimensional char array with three rows and three columns as the game board. Each element of the array should be initialized with an asterisk ..

  Write a class player that contains attributes for the player

Write a class player that contains attributes for the players name,average and team.write three functions to input change and display these attributes. also write a constructor that ask for input to initialize all the attributes.

  Check the product code and calculate the amount

Instead of getting the product names and prices from the standard input, enhance the program to read it from a file instead

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd