Program that prompts the user to enter a test score

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

Program 1: Write a complete C++ program that prompts the user to enter a test score. The test score must be greater than or equal to 0 and less than or equal to 100. If the user enters a test score that is not within the range, prompt the user to re-enter the score. Use a do...while loop.

Program 2: Given the following program. Write a while loop and a do...while loop that have the same output.

#include <iostream>

using namespace std;

int main()

{

            int num = 0, sum = 0;

            for(num = 1; num < 10; num++)

                sum += num;

            cout << "sum = " << sum << endl;

            cout << "Press any key to exit the program.";

            cin.ignore(1);

            return 0;

}

Reference no: EM13693731

Questions Cloud

Important java interfaces and state their objectives : Can you list down some important Java Interfaces and state their objectives?
Predict the products and mechanisms of the reactions : Problem- Predict the products and mechanisms of the following reactions. When more than one product or mechanism is possible, explain which are most likely.
Give examples of pretest and posttest loops : Give examples of pretest and posttest loops - Discuss the syntax of while, for, and do...while loops. Give examples.
Compute kp the pressure-based equilibrium constant : Problem- Compute Kp, the pressure-based equilibrium constant for this dissociation reaction at T = 3000 K. The electronic ground-state degeneracy for O is g0(0) = 9.
Program that prompts the user to enter a test score : Write a complete C++ program that prompts the user to enter a test score. The test score must be greater than or equal to 0 and less than or equal to 100.
Draw (2r,3s)-tartaric acid : Problem- Draw (2R,3S)-tartaric acid. Which stereoisomer of 1, 2-diaminocyclohexane would you expect it toco-crystallize with? Draw (2S,3R)-tartaric acid. Which stereoisomer of 1,2-diaminocyclohexane would you expect it to co-crystallize with?
What do computers do better than humans : Given that computers now do a lot more than "computation", if invented today, what name do you think should be given to the computer, and why - What do computers do better than humans?
Calculate the reactions : Problem- Use data from Appendix IIB in the textbook to calculate ?S?rxn for each of the following reactions.
Write a program that lets the user click on the panel : Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or more points, highlight the pair of closest points. Whenever a new point is created, a new pair of closest po..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to find that number for nguyen.

In some Asian countries, 8 and 6 are considered lucky digits. Any number containing only 8s and 6s is considered lucky number, e.g. 6, 8, 66, 668, 88, 886 .... Nguyen is a student who likes mathematics very much. Nguyen likes lucky numbers but only o..

  Define two derived classes of the abstract class

Define two derived classes of the abstract class ShapeBase below. Your two classes will be called RightArrow and LeftArrow. These classes will draw arrows that point right and left,

  Assume that you have an array of baseball scores type

suppose that you have an array of baseball scores type integer called scores. the values in the array are ordered from

  Supposed to swap numbers

The program is supposed to swap numbers, but I am stuck something is wrong! It does not swap them it repeats the second number, please help to fix! Thanks, this is in C++.

  Compute the average of each row

Write a program that prompts the user to enter 15 double numbers from the keyboard and save them into a 3 by 5 array in the main ( ). Then call a user-define function to compute the average of each row and print the original matrix and average of ..

  Write a program that will represent an axis-aligned

Write a program that will represent an axis-aligned right triangle in the x-y plane as a Class. A right triangle has a right angle (90-degree angle) and two sides adjacent to the right angle, called legs. See http://en.wikipedia.org/wiki/Right_tri..

  Develop and implement an interactive two-player yahtzee game

Eliminate redundancy within a program by applying loops and functions - Create structure charts for a given problem and determine an appropriate functional decomposition or top-down design from a structure chart

  What are the advantages of using variables in a data type

A data type describes the format and size of a data item. However, it does not define the type of operation a data item needs to perform. Do you agree with this statement? Why or why not? What are the advantages of using variables in a data type?

  Write c program-visual studio to scan multiple text files

Write program in C or C++ and Visual Studio to scan multiple text files and count number of occurrences of each word in those files. Use binary tree to keep track of all words.

  Write a method that accepts a string

Write a method that accepts a String object as an argument and displays its contents backward. For instance, if the string argument is "gravity" the method should display - "ytivarg". Demonstrate the method in a program that asks the user to input..

  Composite data types (arrays & records)

Composite data types (arrays & records) can be a problem when they are passed as parameters or returned by functions. Why?

  Write a method, to be included in a template unsorted list

Write a method, to be included in a template unsorted list class that will print (or reurn) the smallest and the largest values in the list.

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