1. Create a console application (core). In the console program's main function, write the C# code...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Create a console application (core). In the console program's main function, write the C# code to do the following: Declare integer variable Y, double variables X and Z, and string S. Initialize X to 2.0 and Z to 4.3 and S to "Enter a number: "as part of the declaration. Write S to the console, and then multiply X by a number entered by the user (read the number from the console) and store back in X. Then set Y equal to the following equation: Z+X 3* sin(X) + 14 Write the final values of X and Y to the console. Make sure to use a readline to pause the program before the console window closes. Following illustrates what the console should look like when run: Microsoft Visual Studio Debug Console Enter a number: 10 X:20 Y:478 C:\Users\gknapp\source epos\ConsoleApp1\bin\Debug etcoreapp3.1\ConsoleApp1.exe (process 7220) exited with cod e 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window. . . Test cases: User enters 10.0 X,Y output should be 20, 478 User enters -2 X,Y output should be -4, -4 2. Add a second console application (core) to your Visual Studio solution. Make it the startup project. In the console program's main function, write the C# code to do the following: Read in the names and ages of two people (say A and B) Set the value of Boolean variable Result. Result should be true if: A is older than B and B is at least 30, or A is at least 10 years younger than B and B is not 50 years old and set to false otherwise. Use string concatenation to create a message. Suppose person A is Joe and B Aimee, and Result is True, then the message should be "For Joe and Aimee, the result is: True" Following illustrates what the console should look like when run: Microsoft Visual Studio Debug Console Enter first person's name: Joe Enter first person's age: 30 Enter second person's name: Aimee Enter second person's age:25 For Joe and Aimee, the result is: False C:\Users\gknapp\source epos\ConsoleApp1\bin\Debug etcoreapp3.1\ConsoleAppl.exe (process 12904) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the conso le when debugging stops. Press any key to close this window... Test cases: A age 30, B age 25: result = false A age 35, B age 30: result = true A age 25, B age 30: result = false A age 50, B age 60: result =true A age 60, B age 50: result = true 1. Create a console application (core). In the console program's main function, write the C# code to do the following: Declare integer variable Y, double variables X and Z, and string S. Initialize X to 2.0 and Z to 4.3 and S to "Enter a number: "as part of the declaration. Write S to the console, and then multiply X by a number entered by the user (read the number from the console) and store back in X. Then set Y equal to the following equation: Z+X 3* sin(X) + 14 Write the final values of X and Y to the console. Make sure to use a readline to pause the program before the console window closes. Following illustrates what the console should look like when run: Microsoft Visual Studio Debug Console Enter a number: 10 X:20 Y:478 C:\Users\gknapp\source epos\ConsoleApp1\bin\Debug etcoreapp3.1\ConsoleApp1.exe (process 7220) exited with cod e 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window. . . Test cases: User enters 10.0 X,Y output should be 20, 478 User enters -2 X,Y output should be -4, -4 2. Add a second console application (core) to your Visual Studio solution. Make it the startup project. In the console program's main function, write the C# code to do the following: Read in the names and ages of two people (say A and B) Set the value of Boolean variable Result. Result should be true if: A is older than B and B is at least 30, or A is at least 10 years younger than B and B is not 50 years old and set to false otherwise. Use string concatenation to create a message. Suppose person A is Joe and B Aimee, and Result is True, then the message should be "For Joe and Aimee, the result is: True" Following illustrates what the console should look like when run: Microsoft Visual Studio Debug Console Enter first person's name: Joe Enter first person's age: 30 Enter second person's name: Aimee Enter second person's age:25 For Joe and Aimee, the result is: False C:\Users\gknapp\source epos\ConsoleApp1\bin\Debug etcoreapp3.1\ConsoleAppl.exe (process 12904) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the conso le when debugging stops. Press any key to close this window... Test cases: A age 30, B age 25: result = false A age 35, B age 30: result = true A age 25, B age 30: result = false A age 50, B age 60: result =true A age 60, B age 50: result = true
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
4. An ice hockey puck travels with a speed of 15 m/s straight towards the extended goal line when it receives a quick blow from a hockey stick. The puck weighs 160 g and receives an impulse from the...
-
C++ Very Important to Read: For program 2 you will be using a string class to read from a file, sort and then output some string . I will give you most of the code for the string class called...
-
Consider two farmers, A and B, produce farm products and sell in the same market. Assume that the supply of the two farmers products are the same but the demand for Farmer Bs product is relatively...
-
For the designs obtained in part (a) of Problem 31, use a computer method to plot the actuator torque versus time. Compare the peak torque values for each case. In problem 31(a) Compute the required...
-
Decision on transfer pricing Materials used by the Instrument Division of Ziegler Inc. are currently purchased from outside suppliers at a cost of $316 per unit. However, the same materials are...
-
Describe the function of various parts of an I.C. engine.
-
Assume the following: Pet Transport (PT) does not make any sales on credit. PT sells only to the public, and accepts cash and credit cards. Of its sales, 90% are to customers using credit cards, for...
-
In the "Stakeholder Analysis in Projects" article this week, the authors Jepsen and Eskerod (2008) found that the "guidelines provided in current literature are far too general to be useful for...
-
1. Golf course designer Roberto Langabeer is evaluating two sites, Palmetto Dunes and Ocean Greens, for his next golf course. He wants to prove that Palmetto Dunes residents (population 1) play golf...
-
The objective function coefficient for product 2 (P2) could increase to a value of without changing the solution quantities? 1 decimal places Which constrint has slack? A. Labor B. Raw 1 C. Raw 2 D....
-
1. Use the United Nations page and Identify the 10 general principles of the Global Compact on human rights, labor, the environment, and the fight against corruption. 2.Mention the effects or...
-
How can intricate interpersonal conflicts be resolved through the adept application of conflict resolution methodologies ?
-
Consider the function f: RR defined by f(x) = cos(x), where n is an even integer. Recall from lectures that one can express f(x) as a linear combination of terms of the form cos(kx), where k are...
-
"Share a situation (personal or business) where you had to decide on a capital budgeting matter, like buying a house or a car or an appliance. Explain how you evaluated the matter and what...
-
Read the case study The Transformational Leadership of Ratan Tata 1. How did Ratan Tatas family background help him as he transformed Tata Group? How might it have presented obstacles or challenges...
-
on 8 For the following set of lengths 130, 170, 160, 160, 150, 190 Third quartile is: et red d out of Select one: O a. 160 a question O b. 145 O c. 175 O d. 180
-
A hydraulic lift in a service station has a \(32.50-\mathrm{cm}\)-diameter ram that slides in a \(32.52-\mathrm{cm}\)-diameter cylinder. The annular space is filled with SAE 10 oil at \(20^{\circ}...
-
A 10-kg block slides down a smooth inclined surface as shown in Fig. P1.80. Determine the terminal velocity of the block if the \(0.1-\mathrm{mm}\) gap between the block and the surface contains SAE...
-
Oil (absolute viscosity \(=0.0003 \mathrm{lb} \cdot \mathrm{s} / \mathrm{ft}^{2}\), density \(=50\) \(\mathrm{lbm} / \mathrm{ft}^{3}\) ) flows in the boundary layer, as shown in Fig. P1.82. The plate...
Study smarter with the SolutionInn App