subject

5.10.4: Snake Eyes Assignment:

"Write a program that rolls two dice until the user gets snake eyes. You should use a loop and a half to do this. Each round you should roll two dice (Hint: use the Randomizer!), and print out their values. If the values on both dice are 1, then it is called snake eyes, and you should break out of the loop. You should also use a variable to keep track of how many rolls it takes to get snake eyes.

Sample Run:

Rolled: 6 5 Rolled: 5 2 Rolled: 3 6 Rolled: 6 2 Rolled: 1 2 Rolled: 5 3 Rolled: 1 4 Rolled: 1 1 It took you 8 rolls to get snake eyes."

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:50
Define a class named movie. include private fields for the title,year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie.write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields.this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie.settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie.setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie.setdirector(temp); //display all the data myfavoritemovie.displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie.cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
5.10.4: Snake Eyes Assignment:

"Write a program that rolls two dice until the user gets...
Questions
question
Law, 24.12.2021 17:20
question
Mathematics, 24.12.2021 17:20
question
Mathematics, 24.12.2021 17:20
question
Chemistry, 24.12.2021 17:20
question
Mathematics, 24.12.2021 17:20
question
Mathematics, 24.12.2021 17:20
question
History, 24.12.2021 17:20
Questions on the website: 13722360