ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 28 Apr 2017 My Price 8.00

NEED IN C++ USING A LOOP

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

Answers

(11)
Status NEW Posted 28 Apr 2017 06:04 AM My Price 8.00

-----------

Not Rated(0)