The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
NEED IN C++
USING A LOOP, create an 8 times table as shown below:
8 X 0 = 0 8 X 1 = 8 8 X 2 = 16 8 X 3 = 24 8 X 4 = 32 8 X 5 = 40 8 X 6 = 48 8 X 7 = 56 8 X 8 = 64 8 X 9 = 72 8 X 10 = 80 8 X 11 = 88 8 X 12 = 96
Â
Modify the program given that produces a square to instead produce a triangle of a certain size. The output should look like the example below. This is an example of where you are better off spending more time thinking than typing; you only need to change one or two lines in the program to get the desired effect:
Enter size: 5 * ** *** **** *****
Â
Ask the user for positive integers; display each value entered. Stop asking when the user enters an odd number. For example:Â
Enter a positive integer: 2 Enter a positive integer: 4 Enter a positive integer: 6 Enter a positive integer: 8 Enter a positive integer: 10 Enter a positive integer: 11 You entered an odd number, so exiting.
Â
USING A LOOP, add all of the numbers between -3 and 8:
Total + -3 = -3 Total + -2 = -5 Total + -1 = -6 Total + 0 = -6 Total + 1 = -5 Total + 2 = -3 Total + 3 = 0 Total + 4 = 4 Total + 5 = 9 Total + 6 = 15 Total + 7 = 22 Total + 8 = 30 The answer is 30
Â
Prompt the user for two numbers, call them "x" and "y". "x" must be less than "y" or reject the entry and stop the program. Otherwise, add up all of the numbers between "x" and "y" and display the result. For example:
Enter x: 10 Enter y, larger than x: 20 Total + 10 = 10 Total + 11 = 21 Total + 12 = 33 Total + 13 = 46 Total + 14 = 60 Total + 15 = 75 Total + 16 = 91 Total + 17 = 108 Total + 18 = 126 Total + 19 = 145 The answer is 145