Home / Expert Answers / Computer Science / software-requirements-prompt-the-user-for-the-number-of-times-to-print-a-message-read-the-number-of-pa667

(Solved): Software Requirements Prompt the user for the number of times to print a message. Read the number of ...



Software Requirements Prompt the user for the number of times to print a message. Read the number of times as an integer into variable

n

. Define an int variable named

i

which is initialized to 1 . Write a loop which executes

n

times by varying the value of

i

from

1,2,3,dots,n

. a. Each time through the loop, print a line of output. b. At the beginning of the output line, print the current value of

i

. c. Following the value of

i

, print a space, followed by the string "I love Computer Sciencell" d. End each output line with a newline. Following the last output line, print the message Printed this message n times. End each output line with a newline. Example 1 How many times should I print? 3 11 love Computer Sciencell 21 love Computer Sciencell 3 I love Computer Sciencelt Printed this message 3 times. Example 2 How many times should 1 print? 6 1 I love Computer Sciencel! 2 I love Computer Science!! 3 I love Computer Sciencell 41 love Computer Science!! 51 love Computer Sciencell 6 I love Computer Science!! Printed this message 6 times.



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe