Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2, Problem 13E
Write a
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write a program that displays a simulated paycheck. The program should ask the user to enter the date, the payee’s name, and the amount of the check. It should then display a simulated check with the dollar amount spelled out, as shown here:
Date: 12/24/2012
Pay to the Order of: John Phillips $1920.85
One thousand nine hundred twenty and 85 cents
You may assume the amount is no greater than $10000. Be sure to format the numeric value of the check in fixed-point notation with two decimal places of precision. Be sure the decimal place always displays, even when the number is zero or has no fractional part. Use either C-strings or string class objects in this program.
Write a program that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average
Python
Write a program that asks the user for two integers that will correspond to the numbering of the first and last lines, then a third integer that will correspond to the number of z before "zigzag" (not counting the first "z" of zigzag), then finally that displays a zig-zag following the following pattern:
Exemple 1:
Start Number: * user type 3 *
End number: * user type 10 *
Number of z: * user type 5 *
zzzzzzigzag 3
4 zzzzzzigzag
zzzzzzigzag 5
6 zzzzzzigzag
zzzzzzigzag 7
8 zzzzzzigzag
zzzzzzigzag 9
10 zzzzzzigzag
(Even integers must be left-zigzag and odd integers must be right.)
Example 2:
Start number:* user type -2 *
End Number:* user type 4 *
Number of z: * user type 3 *
-2 zzzzigzag
zzzzigzag -1
0 zzzzigzag
zzzzigzag 1
2 zzzzigzag
zzzzigzag 3
4 zzzzigzag
Example 3:
Start Number:* user type 5 *
End number:* user type 0 *
Number of z: * user type 10 *
(Nothing is displayed because 5>0)
Chapter 2 Solutions
Microsoft Visual C#
Ch. 2 - Prob. 1RQCh. 2 - Prob. 2RQCh. 2 - Prob. 3RQCh. 2 - Assume that you have two variables declared as int...Ch. 2 - Assume that you have a variable declared as...Ch. 2 - Assume that you have a variable declared as int...Ch. 2 - Assume that you have a variable declared as int...Ch. 2 - Prob. 8RQCh. 2 - Assume that you have a variable declared as int...Ch. 2 - Assume that you have a variable declared as int...
Ch. 2 - Prob. 11RQCh. 2 - Which of the following is not a C# comparison...Ch. 2 - Prob. 13RQCh. 2 - Which of the following C# types cannot contain...Ch. 2 - Assume that you have declared a variable as double...Ch. 2 - Assume that you have declared a variable as double...Ch. 2 - When you perform arithmetic operations with...Ch. 2 - Prob. 18RQCh. 2 - Prob. 19RQCh. 2 - Which of the following compares two string...Ch. 2 - What is the numeric value of each of the following...Ch. 2 - What is the value of each of the following Boolean...Ch. 2 - Choose the best data type for each of the...Ch. 2 - In this chapter, you learned that although a...Ch. 2 - Write a C# program named InchesTOCentmeters that...Ch. 2 - Prob. 6ECh. 2 - Write a C# program named ProjectedRaises that...Ch. 2 - Convert the ProjectedRaises class to an...Ch. 2 - Malcolm Movers charges a base rate of $200 per...Ch. 2 - Prob. 10ECh. 2 - Write a program named Eggs that declares four...Ch. 2 - Modify the Eggs program to create a new one named...Ch. 2 - Write a program named MakeChange that calculates...Ch. 2 - Write a program named Testslnteractive that...Ch. 2 - Write a program named FahrenheitToCelsius that...Ch. 2 - Prob. 16ECh. 2 - Prob. 17ECh. 2 - Pig Latin is a nonsense language. To create a word...Ch. 2 - Each of the following files in the Chapter.02...Ch. 2 - In Chapter 1, you created two programs to display...Ch. 2 - Prob. 2CP
Knowledge Booster
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
- Write a program named GuessingGame that generates a random number between 1 and 10. (In other words, in the example above, 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 users guess was too high, too low, or correct.arrow_forwardWrite a program that computes the molecular weight of a carbohydrate (ingrams per mole) based on the number of hydrogen, carbon, and oxygenatoms in the molecule. The program should prompt the user to enter thenumber of hydrogen atoms, the number of carbon atoms, and the numberof oxygen atoms. The program then prints the total combined molecularweight of all the atoms based on these individual atom weights:Atom Weight(grams I mole)H 1.00794c 12.01070 15.9994For example, the molecular weight of water (H20) is: 2(1.00794) +15.9994 = 18.01528.arrow_forwardWrite a program that will calculate the cost of carpeting. We-do-Carpets is a company that specializes in carpeting homes. The company is interested in new software for their sales staff. The software needs to provide quotes to potential customers. Your program should: Prompt the user to enter in lengths and widths for the following rooms Living Room Master Bedroom Family Room Kids Bedroom Calculate the cost of carpeting for each room Calculate the sub total cost for all rooms Calculate the 6.625 NJ Sales Tax Calculate the grand Total use java programming Your program must be formatted according to the output Sample Outputarrow_forward
- write a program in python Write a program that will allow a student to enter their name and then ask them to solve 10 mathematical equations. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. The program should then display whether their answer was right or wrong, and accumulate the right values. After the 10 questions are asked, calculate the average that was correct. Then display the student name, the number correct, and the average correct in both decimal and percentage format. In addition to any system functions you may use, you might consider the following functions: A function that allows the student to enter their name. A function that gets two random numbers, anywhere from 1 to 500. A function that displays the equation and asks the user to enter their answer. A function that checks to see if the answer is correct and accumulates the number correct. A function that calculates the…arrow_forwardWrite an application that prompts for and reads "double" value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assuming that a ten-dollar bill is the maximum size needed). For example, if the value entered is 47.63, then the program should print the equivalent amount as:4 ten dollar bills1 five dollar bills2 one dollar bills2 quarters1 dimes0 nickels3 pennies Using your Eclipse / Java integrated development environment (IDE), develop and code a solution to Programming Project 2.11 from pages 94-95 of the text book.arrow_forwardWrite a program that gives simple math quizzes. The program should display two randomnumbers that are to be added, such as:247+ 129The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed.arrow_forward
- Write a program that calculate electricity bill. The program prompts the user to enter the amount of KWh units of electricity consumed, the task is to calculate the electricity bill total with the help of the below charges: 1 to 50 units of total units – Unit price=10 50 to 100 units of total units – Unit price=15 above 100 units – Unit price=20 - Sample Run1: Enter the amount of KWh units U: 250 Total Bill: 4250 Explanation: Charge for the first 50 units - 10*50 = 500 Charge for the 50 to 100 units - 15*50 = 750 Charge for the 100 to 250 units - 20*150 = 3000 Sample Run2: Enter the amount of KWh units U: 95 Total Bill: 1175 Explanation: Charge for the first 100 units - 10*50 = 500 Charge for the 50 to 100 units - 15*45 = 675arrow_forwardUsing pythonarrow_forwardWrite a program that calculate electricity bill. The program prompts the user to enter the amount of KWh units of electricity consumed, the task is to calculate the electricity bill total with the help of the below charges: • 1 to 50 units of total units - Unit price=10 • 50 to 100 units of total units - Unit price=15 • above 100 units - Unit price=20 Sample Runl: Enter the amount of KWh units U: 250 Total Bill: 4250 Explanation: Charge for the first 50 units - 10 50 500 Charge for the 50 to 100 units - 15 50 - 750 Charge for the 100 to 250 units - 20*150 - 3000 Sample Run2: Enter the amount of KWh units U: 95 Total Bill: 1175 Explanation: Charge for the first 100 units - 10*50 - 500 Charge for the 50 to 100 units - 15 45 675arrow_forward
- Write a program that lets the user guess whether a flipped coin displays the head or the tail. The program randomly generates an integer 0 or1, which represents head or tail. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.arrow_forwardDesign a program to do the administration for a fun run competition. Participants can run a distance of 5 kilometers, 10 kilometers or 15 kilometers. Ask the user if they wish to register a participant (Y or N).Ask whether the person is a member (Y or N)Ask the distance that the person wishes to run (5, 10, 15). Registration fees for club members are as follows:5km = R 65.0010km = R 100.0015km = R 150.00 Non-members:For the 5 and 10 kilometers distances, the participation fees must be increased by 25%For the 15 kilometer distance the registration fee is double that of club members. Use the given criteria and input information to calculate the registration fee.The program must keep track of the total number of participants per distance category, the total amount received per distance category and total amount received.The program must also calculate the total number of participants and the total number of club members who registered.The program must identify the category with the…arrow_forwardWrite a program that accepts the names of three political parties and the number of votes each received in the last mayoral election. Display the percentage of the vote each party received. An example of the program is shown below: Enter name for first party >> Pool Party Enter votes received >> 87 Enter name for second party >> House Party Enter votes received >> 54 Enter name for third party >> Surprise Party Enter votes received >> 111 The Pool Party party got 34.523809523809526 percent of the vote The House Party party got 21.428571428571427 percent of the vote The Surprise Party party got 44.047619047619044 percent of the votearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY