1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alinara [238K]
3 years ago
14

Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th

an 10000. The user has 10 tries to guess the number.
Computers and Technology
1 answer:
Burka [1]3 years ago
8 0

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

You might be interested in
Computers are often referred to as _____.
GalinKa [24]
Smart machines I'm pretty sure
4 0
3 years ago
. What is the relationship between frequency, wavelength and speed of a wave?
jeka94

Answer:

vw = fλ

Explanation:

Sound, like all waves, travels at a certain speed and has the properties of frequency and wavelength. You can observe direct evidence of the speed of sound while watching a fireworks display. The flash of an explosion is seen well before its sound is heard, implying both that sound travels at a finite speed and that it is much slower than light. You can also directly sense the frequency of a sound. Perception of frequency is called pitch. The wavelength of sound is not directly sensed, but indirect evidence is found in the correlation of the size of musical instruments with their pitch. Small instruments, such as a piccolo, typically make high-pitch sounds, while large instruments, such as a tuba, typically make low-pitch sounds. High pitch means small wavelength, and the size of a musical instrument is directly related to the wavelengths of sound it produces. So a small instrument creates short-wavelength sounds. Similar arguments hold that a large instrument creates long-wavelength sounds.

The relationship of the speed of sound, its frequency, and wavelength is the same as for all waves: vw = fλ, where vw is the speed of sound, f is its frequency, and λ is its wavelength. The wavelength of a sound is the distance between adjacent identical parts of a wave—for example, between adjacent compressions as illustrated in Figure 2. The frequency is the same as that of the source and is the number of waves that pass a point per unit time.

5 0
3 years ago
Brainiest To Best Answer!! Java coding help, can you tell me what Switch and Case does using the example below?
fiasKO [112]
The switch statement is an n-way branch. An n-way branch can branch to any of an arbitrary number ( n ) of branches. An if statement can branch two ways, whether the condition is true or false.

The example you gave is a great example of how how code is written can make the code make sense or not.

public void setQuiz( int quiz, int grade )
{
  switch( quiz )
  {
    case 1: // if quiz == 1
      grade1 = grade; //where was grade1 declared?
      break;  // otherwise execution will continue through the next case block
    case 2: // if quiz == 2
      grade2 = grade;
      break;
  }
}

The variable named in the switch statement is tested against each case statement and whichever case statement's value matches, the rest of the switch statement's code is executed. (That's why the break statements are needed) Usually switch statements are written with a default case at the end as a "catchall".
4 0
4 years ago
When doing a complex presentation, which of the following would be the best tool to begin designing your presentation?
Dafna1 [17]
An outline can be a best tool to begin describes a presentation....
4 0
4 years ago
Read 2 more answers
The Healthcare Innovation and Technology Lab would most likely be interested in which of the following app types?
prisoha [69]

Answer:

No. 4: An app to send data from an insulin pump to a data collection point.

Explanation:

Healthcare Innovation and Technology Lab would not mainly be focused with budgeting, book reading, and home insurance policies. Answer number 4 includes health and technology.

7 0
3 years ago
Other questions:
  • What company handles security for a lot of the e-commerce on the internet and also maintains two root name server clusters?
    8·1 answer
  • In a PowerPoint presentation, it is not possible to add notes that are hidden from the audience's view.
    9·1 answer
  • What layer uses the UDP protocol
    6·1 answer
  • Why you think Operating System is pivotal in teaching and learning.
    13·1 answer
  • What is the unemployment rate if the GDP gap is 13.5%?<br><br> A. 6.25%<br> B. 6.75%<br> C. 6.7%
    8·1 answer
  • A firm has a huge amount of individual customer data saved in different databases. Which of the following can be used to integra
    11·1 answer
  • . Convert your age into binary and then to hexadecimal. Show your work.
    5·1 answer
  • Biosolids are used as a chemical free natural choice for fertilizing.
    5·1 answer
  • The core of ___________ is the implementation of intrusion detection systems and intrusion prevention systems at entry points to
    8·1 answer
  • Sean is frustrated with having to use separate editors, compilers, libraries, plug-ins, and debugers. What could Sean use to mak
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!