Please use c code Write a C program that every integer betwe

(Please use c++ code)
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:

Solution

#include <iostream>

using namespace std;

int main()
{
long int number;
int count=1;
for(;count=1;){ //This is infinite loop
cout<<\"What is the number?\"<<endl;
cin>>number; //prompting the user to enter input
if(number<1776) //checking the condition
cout<<\"Too small\"<<endl;
else if(number>1776)
cout<<\"Too big\"<<endl;
else if(number==1776){
cout<<\"You got it\"<<endl;
break; //if number equal to given number breaks the loop
}
}
return 0;
}

---------------------------------------------------------------------------------------------------------------------------------------------------

#include<iostream>
#include<cstdlib>

using namespace std;
void randomInteger(){ //creating a function named randomInteger

for ( i= 1 ; i< 100:i++) //loop rotates for 99imes to get 99 random numbers
{
num = random(100); //geet random number max is 100
cout << num << endl;
}   
}
main()
{
randomInteger(); //calling randomInterger function

return 0;

}

---------------------------------------------------------------------------------------------------------------------------------------------

/*
n result
2 prime
3 prime
4 not prime
5 prime
6 not prime
7 prime
8 not prime
*/

#include <iostream>

using namespace std;

int main()
{
int number;
int j;
for(int i=1;i<=8;i++){
cout<<\"Enter the number greater than 1\"<<endl;
cin>>number;
for(j=2;j<=number-1;j++){
if(number%j==0){
cout<<\"not prime\"<<endl;
break;
}
}
if(j==number)
cout<<\"prime\"<<endl;
}
return 0;
}

(Please use c++ code) Write a C++ program that every integer between 330 and 550, inclusive. Write a program that implements Guess-the-Number game. The program
(Please use c++ code) Write a C++ program that every integer between 330 and 550, inclusive. Write a program that implements Guess-the-Number game. The program

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site