8. Write a program that allows the user to enter two integers and a character If the character is A, add the two integers If it is S, subtract the second integer from the first if it is M, multiply the integers Display the results of the arithmetic

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 5E: a. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered...
icon
Related questions
Question


8. Write a program that allows the user to enter two integers and a character If the character is A, add the two integers If it is S, subtract the second integer from the first if it is M, multiply the integers Display the results of the arithmetic

The following problems requires nested if-statements
9. Write a console-based application that asks a user to enter an IQ score. If the score is a number less than 0 or greater than 200, issue an error message; otherwise, issue an “above average”, “average”, or “below average” message for scores over, at, or under 100, respectively.
10. Write a console-based program that prompts a user for an hourly pay rate. If the user enters values less than $7.50 or greater than $49.99, prompt the user again. If the user enters an invalid value again, display an appropriate error message. If the user enters a valid value on either the first or second attempt, display the pay rate as well as the weekly rate, which is calculated as 40 times the hourly rate.
11. Write a console-based program for a college’s admissions office. The user enters a numeric high school grade point average (for example, 3.2) and an admission test score. Display the message “Accept” if the student meets either of the following requirements:
A grade point average of 3.0 or higher and an admission test score of at least 60
A grade point average of less than 3.0 and an admission test score of at least 80
If the student does not meet either of the qualification criteria, display “Reject”.
12. Write a console-based program for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot less than 400 square feet is $25. The fee for a lot that is 400 square feet or more, but less than 600 square feet, is $35 per week. The fee for a lot that is 600 square feet or over is $50 per week. Prompt the user for the length and width of a lawn, and then display the weekly mowing fee, as well as the total fee for the 20-week season.
13. To the Lawn application you created in the above question, add a prompt that asks the user whether the customer wants to pay (1) once, (2) twice, or (3) 20 times per season. If the user enters 1 for once, the fee for the season is simply the seasonal total. If the customer requests two payments, each payment is half the seasonal fee plus a $5 service charge. If the user requests 20 separate payments, add a $3 service charge per week. Display the number of payments the customer must make, each payment amount, and the total for the season.
14. Write a program that calculates the tax on an item, based on the province code. Your program will prompt the user for the 2-letter province code, and the cost of the item and then computes the tax based on the following table:
Province Rate
ON 14%
PQ 13%
Any other province 0%
Use named constants and if’s.
Try to accommodate all permutations of the 2-letter code.
15. You can create a random number that is at least min but less than max using the following statements:
Random ranNumberGenerator = new Random();
int randomNumber;
randomNumber = ranNumberGenerator.Next(min, max);
Write a console-based program that generates a random number between 1 and 10. (In other words, min is 1 and max is 11.) Ask a user to guess the random number, then display the random number and a message indicating whether the user’s guess was too high, too low, or correct.
16. In the game Rock Paper Scissors, two players simultaneously choose one of three options: rock, paper, or scissors. If both players choose the same option, then the result is a tie. However, if they choose differently, the winner is determined as follows:
Rock beats scissors, because a rock can break a pair of scissors.
Scissors beats paper, because scissors can cut paper.
Paper beats rock, because a piece of paper can cover a rock.
17. Create a console-based game in which the computer randomly chooses rock, paper, or scissors. Let the user enter a character, ‘r’, ‘p’, or ‘s’, each representing one of the three choices. Then, determine the winner.

18. Create a console-based lottery game application. Generate three random numbers, each between 1 and 4. Allow the user to guess three numbers. Compare each of the user’s guesses to the three random numbers and display a message that includes the user’s guess, the randomly determined three-digit number, and the amount of money the user has won as follows:
Matching Numbers Award ($)
Any one matching 10
Two matching 100
Three matching, not in order 1,000
Three matching in exact order 10,000
No matches 0
Make certain that your application accommodates repeating digits. For example, if a user guesses 1, 2, and 3, and the randomly generated digits are 1, 1, and 1, do not give the user credit for three correct guesses—just one.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr