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

  Logarithmic scale for the x- and y-axes

Graph the functions 8n, 4nlogn, 2n2, n3, and 2n using a logarithmic scale for the x- and y-axes.

  Write pseudo algorithm which inputs age for valid voting

Write pseudo algorithm which inputs Age, displays "Yes, you can vote" if Age is 18 or older and displays "You are too young to vote" if Age is less than 18, and displays nothing else.

  Program to display number of times name appears in file

You have read all names from the file, display number of times this name appears in file. write logic - step by step - to show code program to accomplish this task.

  Create the logic for a program which merges two files

Create the logic for a program which merges the two files into one file containing list of all students in district, maintaining student id number order.

  Write the function day

Write the function day(d, m) where m is an integer from 1 through 12 expressing a month, and d is an integer from 1 through 31 expressing the day part of a date in 2014. The function should return the day name ('Mo', 'Su'.etc)

  Confi gure the repository and define the repository

Configure the repository and define the repository usernames and passwords - Install the subversion package.

  Write program that takes input arithmetic expression

Write a program that takes as input an arithmetic expression. The program outputs whether the expression contains matching grouping symbols.

  Program to prompt teacher to input assignment number

The program must prompt teacher to input the assignment number. Score for student for that assignment will be displayed.

  Write a script that inputs a numeric check amount

Write a script that inputs a dollar amount to be printed on a check, then prints the amount in check protected format with leading asterisks if necessary. Assume that nine spaces are available for printing the amount.

  How to assign new value to element of array indexed by j

Write single statement which assigns a new value to element of array indexed by j . This new value must be equal to twice the value stored in next element of the array (i.e. element after the element indexed by j.

  What criterion is being used to determine the best estimates

What we would like to do is create similar tables in an .rtf file that produces the same statistics for any numerical value against each level of a know classification/factor from any data set we wish to inspect.

  Design logic for application to allow user to enter item

Design the logic for an application that allows a user to enter an ordered item continuously until a sentinel value is entered. After each item, display its price or the message.

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