Need Help ?

Home / Expert Answers / Other / exercise-1-please-use-c-code-write-a-c-program-that-every-integer-between-330-and-550-inclusive-writ

(Answered): Exercise 1(Please use c++ code) Write a C++ program that every integer between 330 and 550, inclusiv ...



Exercise 1(Please use c++ code)
Write a C++ program that every integer between 330
Write a C++ program that every integer between 330 and 550, inclusive. Write a program that implements Guess-the-Number game. The program should enter a loop that starts by printing "What is the number?" After printing this, it reads the user response, (Use cin >> n to read the user response.) If the user enters a value less than 1776, the program prints "too small" and continues the loop. If the user enters a number larger than 1776, the program prints "too big" and continues the loop. If the user enters the number 1776, the program prints "you got it" and then terminates. Write a program that generates a list of 100 random integers on (0, 100), which means between 0 and 99 inclusive. To solve this problem, use the randominteger function you developed for the A3 Functions assignment. In other words, use a loop to call the randominteger function 100 times. Save the program output by redirecting the standard output stream to a file. To do this, run the program as follows. ./a.out > numbers.txt Open numbers.txt in a text editor to see the result. Write a console program that asks the user to enter an integer greater than 1. The program determines if the number entered is prime and writes a message to standard output stream staling whether the number is prime or not. For example, if the user enters 42. the program displays "42 is not prime." If the user enters 47, the program displays "47 is prime." Develop 8 test cases and verify that your program runs correctly for them. The test cases should contain some prime numbers as well as non-prime values. Include test cases that try to break your program so that you are sure you have implemented the code correctly. Include the 8 test cases within a multi-line comment near the top of your source code fie Make sure the comment is nicely organized and easy to read and understand. Here is an example:


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to Write a C++ program that every integer between 330 and 550, inclusive. Write a program that implements Guess-the-Number ...
We have an Answer from Expert

Buy This Answer $4

Place Order