Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2, Problem 5E
Write a C#
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Please provide the whole JAVA source code for attached screenshot's assignment.
1#
Write a program that allows users to choose from one of three shapes: Squares, Circles or (right)
Triangles. Allow the user to use the first letter of the shape (S, C, T) to specify what they want. After the
shape is selected, ask the user for the appropriate data to calculate the shape's area, and then and print
that area value to the screen for them.
Area formulas you can use:
Triangle: % base x height
Square: length x length
Circle: % Pl x radius?
Notes:
The floating-point data type will be your friend here. Round your area answer so that no more
than 2 decimal places are shown when printing on the screen.
You can use 3.1415 for Pl; Think about this as a CONSTANT in your code.
For this part and especially part (b) below, think about componentizing your code. So one
gigantic main() is not a best practice and not what we want to see here. Remember what we
discussed about "procedural decomposition" and functions last week!
Using C# in Microsoft Visual Studio create an application that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)• If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors…
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 Eggs that declares four variables to hold the number of eggs produced in a month by each of four chickens, and assign a value to each variable. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.arrow_forwardWrite a program that declares a named constant to hold the number of quarts in a gallon (4). Also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. Compute and display the number of gallons and quarts needed for the job. Display explanatory text with the values—for example, A job that needs 18 quarts requires 4 gallons plus 2 quarts. Save the program as QuartsToGallons.java. Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as input. Save the revised program as QuartsToGallonsInteractive.java.arrow_forwardPlease written by computer source # with visual studio. Windows Form app (.NET Framework)arrow_forward
- TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM. Write an application that reads a value representing a number of seconds, then displays the equivalent amount of time as a combination of hours, minutes, and seconds. For example, 9999 seconds is equivalent to 2 hours, 46 minutes, and 39 seconds. Hint: This requires using the % modulus operator. The trick with multiple units of measure like this is to start with the largest unit (hours) and work down. Testing: Submit testing exhibits using the following inputs: 0, 1, 60, 3600, 3661, and 9999arrow_forwardHow do I do this? C#arrow_forwardWrite a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4 percent raise for each employee in a company. Also declare variables to represent the current salaries for three employees. Assign values to the variables, and display, with explanatory text, next year’s salary for each employee. Note: For final submission assign the following current salaries for the employees: 25000 for employee 1, 38000 for employee 2, 51000 for employee 3. Then next year's salary for employee 1 would be displayed as: Next year's salary for the first employee will be $26,000.00 In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {0}", value.ToString("C", CultureInfo.GetCultureInfo("en-US")));arrow_forward
- C# Account numbers sometimes contain a check digit that is the result of a mathematical calculation. The inclusion of the digit in an account number helps ascertain whether the number is a valid one. Write an application named CheckDigit that asks a user to enter a four-digit account number and determines whether it is a valid number. The number is valid if the fourth digit is the remainder when the number represented by the first three digits of the four-digit number is divided by 7. For example, 7770 is valid, because 0 is the remainder when 777 is divided by 7. If the account number is valid, output The account number is valid. If the account number is invalid output Invalid. If the account number is too short or too long output Account number invalid - it must have 4 digits.arrow_forwardCreate a C# program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded methods that accept an int, double, or string bid. Each method should display the bid and indicate whether it is over the minimum acceptable bid of $10. If the bid is greater than or equal to $10, display Bid accepted. If the bid is less than $10, display Bid not high enough. If the bid is a string, accept it only if one of the following is true: It is numeric and preceded with a dollar sign. It is numeric and followed by the word dollars. Otherwise, display a message that says Bid was not in correct format.arrow_forwardCreate a C# program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded methods that accept an int, double, or string bid. Each method should display the bid and indicate whether it is over the minimum acceptable bid of $10. If the bid is greater than or equal to $10, display Bid accepted. If the bid is less than $10, display Bid not high enough. If the bid is a string, accept it only if one of the following is true: It is numeric and preceded with a dollar sign. It is numeric and followed by the word dollars. Otherwise, display a message that says Bid was not in correct format. using static System.Console; public class Auction { static void Main() { // Write your main here } public static void AcceptBid(int bid, int min) { } public static void AcceptBid(double bid, int min) { } public static void AcceptBid(string bid, int min) { } }arrow_forward
- Create a C# program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded methods that accept an int, double, or string bid. Each method should display the bid and indicate whether it is over the minimum acceptable bid of $10. If the bid is greater than or equal to $10, display Bid accepted. If the bid is less than $10, display Bid not high enough. If the bid is a string, accept it only if one of the following is true: It is numeric and preceded with a dollar sign. It is numeric and followed by the word dollars. Otherwise, display a message that says Bid was not in correct format.arrow_forwardMY CODE : # TODO: Write your header comment here. # Ending statements with the period to easily split them as mentioned in the question. questions = [ "I am the life of the party. E:1", "I warm up quickly to others. A:1 E:1", "I never at a loss for words. O:1 E:1", "I seldom get lost in thought. C:1 O:-1", "I am easily distracted. N:-1 C:-1" ] # Store the printed statement and answer options in string variables welcome_message = "Welcome to the Personality Quiz!" answer_prompt = "Enter your answer here (1-5): " # Function to extract the statement from a question string def extract_statement(question): return question.split('.', 1)[0] # Initialize an empty list to store user answers user_answers = [] # Print the welcome message print(welcome_message + "\n") # Ask the user all five questions and record their answers for i in range(5): # Get the selected question selected_question = questions[i] # Extract the statement from the selected question…arrow_forwardMicrosoft Visual C# 7th edition. need help, please. Thanks In previous chapters, you created applications for Marshall’s Murals. Now, modify the version of the MarshallsRevenue program created in Chapter 5 so that after mural data entry is complete, the user is prompted for the appropriate number of customer names for both the interior and exterior murals and a code for each that indicates the mural style: L for landscape S for seascape A for abstract C for children’s O for other When a code is invalid, re-prompt the user for a valid code continuously. For example, if Y is input, output Y is not a valid code, and re-prompt the user until a valid code is entered. After data entry is complete, display a count of each type of mural. For example the output should be in the following format with the correct number next to each mural type: The interior murals scheduled are: Landscape 1 Seascape 2 Abstract 1 Children's 3 Other 9 The exterior murals scheduled are: Landscape 4 Seascape 0…arrow_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
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License