1. Which of the following expressions will return the square root of the number 16? a. pow(16.0, 2) alb. sqrt(16.0) c. sqrt(16.0, 0.5) d. both a and b

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
290
CHAPTER 9
Value-Returning
Game pp - number quessing game
ced/revised by svour name> on <current date>
wora
2.
bobare
required for the
time function
#include <iostream>
#include <ctime>
//#include <cstdlib>
7 using namespace std;
8
9 int mainO
10 {
your
this directive to use the
rand and srand functions
noiteonooge meldo
Tadhmun mob
3.
mor
11
12
7/generate a random number from 1 through 10
srand (static_cast<int>(time (0)));
randomNumber = 1 + randO % (10 - 1 + 1);
Tht numberGuess - 0:nedod t yd bowolot
13
14
15
16
17
18
19
4-
cout << "Guess a number from 1 through 10: ";
cin >> numberGuess;
//get first guess from user
20
21
22
23
24
25
26
27
while (numberGuess != randomNumber)
{
cout <« "Sorry, guess again: ";
cin >> numberGuess;
//end while
28
29
cout <« endl << "Yes, the number is
<« randomNumber <<
return 0;
<« endl;
30
A
31 } //end of main function
19dmulinobnsT
a
N Guessing Game
- O
Guess a number from 1 through 10: 5
Sorry, guess again: 8 2 ocua
Sorry, guess again: 2
2003
Yes, the number is 2.
Press any key to continue
ofw bns
Figure 9-11
Guessing game program
The answers
Mini-Quiz 9-1
nodsmon
to Mini-Quiz
questions are
contained in the
Answers.pdf file.
msido1
Which of the following expressions will return the square root of the number 16?
mobi a. pow(16.0, 2)
lb. sgrt(16.0)
1.
C. sqrt(16.0, 0.5)
d. both a and b
Transcribed Image Text:290 CHAPTER 9 Value-Returning Game pp - number quessing game ced/revised by svour name> on <current date> wora 2. bobare required for the time function #include <iostream> #include <ctime> //#include <cstdlib> 7 using namespace std; 8 9 int mainO 10 { your this directive to use the rand and srand functions noiteonooge meldo Tadhmun mob 3. mor 11 12 7/generate a random number from 1 through 10 srand (static_cast<int>(time (0))); randomNumber = 1 + randO % (10 - 1 + 1); Tht numberGuess - 0:nedod t yd bowolot 13 14 15 16 17 18 19 4- cout << "Guess a number from 1 through 10: "; cin >> numberGuess; //get first guess from user 20 21 22 23 24 25 26 27 while (numberGuess != randomNumber) { cout <« "Sorry, guess again: "; cin >> numberGuess; //end while 28 29 cout <« endl << "Yes, the number is <« randomNumber << return 0; <« endl; 30 A 31 } //end of main function 19dmulinobnsT a N Guessing Game - O Guess a number from 1 through 10: 5 Sorry, guess again: 8 2 ocua Sorry, guess again: 2 2003 Yes, the number is 2. Press any key to continue ofw bns Figure 9-11 Guessing game program The answers Mini-Quiz 9-1 nodsmon to Mini-Quiz questions are contained in the Answers.pdf file. msido1 Which of the following expressions will return the square root of the number 16? mobi a. pow(16.0, 2) lb. sgrt(16.0) 1. C. sqrt(16.0, 0.5) d. both a and b
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education