Write a number guessing game program

Assignment Help Programming Languages
Reference no: EM13907368

1. Ask the user for a color
2. If the user types your favorite color (if you don't have one, pick blue), output That is my favorite color to the console Otherwise, output What color is that again?

Create a flowchart and do the following
1. Ask the user for how many cats they own (use the variable cats)
2. Assign cats into the variable animals
3. Ask the user for how many dogs they own (use the variable dogs)
4. Increment animals by the value of the variable dogs
5. Output the value of animals, which should now be the total number of cats and dogs

Instructions

Create a flowchart and do the following
1. Assign 15 into the variable count
2. Increment count by 7
3. Output the value of count to the Master Console

Create a flowchart and do the following
1. Add a loop symbol
2. Initialize the loop control variable count with the value of 0 (before the loop)
3. Use count = 5 as the loop Boolean expression
4. Inside the loop do the following in order

1. output the string hey
2. increment count by 1

Create a flowchart and do the following
1. Add a loop symbol
2. Initialize the loop control variable num with the value of 0
3. Inside the loop ask the user for a number. if the number is equal to 5 exit the loop.
4. When the loop exits, output the message Finished!

Part I

Write a number guessing game program. The program will first generate a random number from 1 to 100. Then, the user guesses a number and the game will report whether the guess is too low or too high. if the guess is correct the game will report that the user won.

To generate a random integer from 1 to n, use floor ( (random * n) + 1)

For example, to generate a random number from 1 to 6, use the following code: floor ( (random 6) + 1)

Part II

Add a variable for the number of tries, and when the user wins report how many tries it took them.

Instructions

Jse a loop to Ask the user for 5 test scores (1 to 100) and store them in an array then, output the numbers backwards

Extra Credit

Find the lowest, highest & average test score (using a loop)

Reference no: EM13907368

Questions Cloud

Program that declares three variables minnum : Write a C++ program that declares three variables minNum, midNum and maxNum to receive three integers read from the keyboard.
Where security is an it concern. : Take a few minutes to consider all areas where security is an IT concern. Select one you think is the most important and explain why you consider it important. As we go through the course,  visit this topic again and see if you agree with your first ..
Requires an initial cash outlay : AXY requires an initial cash outlay of $675,000 for equipment. You expect to spend an additional $45,000 in the first year to cover costs as the project will produce negligible cash inflows for that year. During years 2 through 6, you expect to recei..
What would the risk-free rate have to be for the two stocks : Stock Y has a beta of 1.3 and an expected return of 13 percent. Stock Z has a beta of 0.75 and an expected return of 10.5 percent. What would the risk-free rate have to be for the two stocks to be correctly priced relative to each other?
Write a number guessing game program : Write a number guessing game program. The program will first generate a random number from 1 to 100. Then, the user guesses a number and the game will report whether the guess is too low or too high.
Considering an annuity which costs : You are considering an annuity which costs $54200 today. The annuity pays $5800 a year. The rate of return is 6 percent. What is the length of the annuity time period?
Exist at the start of the next decade : Which jobs that exist today likely will not exist at the start of the next decade? Based on your best guess on how technology will develop, can you think of jobs and skill sets that will likely emerge as critical five and 10 years from now?
Who are the stakeholders in this situation : However, if you disclose news of the dump problem now, the offering will likely be jeopardized. But the prospect of holding a news conference and explaining your role in keeping the dump a secret keeps you up at night - Who are the stakeholders in..
Treausy rate-what is this stocks required rate of return : The ten year US Treausy rate is currently 3.37%, the long term expected market rate is 11.5%, and a stock's beta is 1.47. Using CAPM, what is this stocks required rate of return

Reviews

Write a Review

Programming Languages Questions & Answers

  Write application to calculate average of temperature

Write the application to calculate average of set of temperature readings. Application prompts user to enter the number of temperature readings to be entered, then prompts user to enter temperature.

  Create the array to determine discount amount

Create the array (DISCOUNT-ARRAY) that will be used to determine discount company will give based on amount of an order.

  Direction and magnitude be integers or doubles

Design the program consider Will the direction and magnitude be integers or doubles - will the input vectors be passed by value, by reference, or by const reference?

  Assume the filling process is so slow that the tank air

a large compressed air storage tank with a volume of 100 m3is initially at 200 kpa and 288 k. the supply line valve is

  Write a method that returns the value of base exponent

Write a method IntegerPower(base, exponent) that returns the value of base exponent For example, IntegerPower(3, 4) = 3 * 3 * 3 * 3.

  Write a program to read the data from csv file

Write a program that will read the data from the CSV file into an ArrayList of State objects where each State object stores information about all County objects for that state.

  Create program to randomly access data on stocks

A small mutual company wishes you to create program to randomly access data on stocks it holds. Presently, data are stored in a text file, each line of which contains following: a stock code.

  Program to calculate sum of squares using for loop

Given int variables k and total that have already been declared, use for loop to calculate sum of squares of first 50 counting numbers, and store this value in total.

  Write function is pseudocode to calculate area of triangle

Write down the function is pseudocode called calculate area which calculates the area of a triangle. Algorithm for area computation is this: area=1/2*base*height.

  Run the program with a file name

Write a short Python program that asks the user to input two numbers, and then divides the first number by the second. The program must use an exception handling structure to process the situation when the denominator is zero. Run your program wit..

  Create a three-page website that displays text and links

Create a three-page website that displays text and links, demonstrating effective use of the basic code from chapter 2. You will build three (3) new HTML documents, and must use http://www.lipsum.com to generate placeholder text for the written co..

  Implement a program that processes an input file

Implement a program that processes an input file by changing every occurrence of an old string into a new string. (e.g., the usage is: chstr.pl file oldstring newstring, chstr.pl is your program name, file, oldstring and newstring are parameters ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd