Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 2, Problem 3RQ
Program Plan Intro
To choose the correct statement regarding variable declarations.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Computer ProgrammingLanguage: CConditional Statements
Complete the following program
When a machine reads blood pressure from a human body it displays two numbers they are called Systolic and Diastolic
pressures.
The program will take systolic and diastolic reading as input from the user and displays a message whether the person's
plood pressure is "Normal" or "Elevated" or "High Blood Pressure".
Program consists of two functions as follows.
vold input( .):This function is with two pass by reference parameters, and it reads input from the user.
itring process.): It receives two numbers(systolic and diastolic) and then it determines and returns a category
Iccording to the table below.
Systolic
80 to 120
Diastolic
and 60 to 80
80 to 90
Category
Normal
Elevated
120 to 139
and
equal and
above 140
High blood
pressure
above 90
or
main () program is given below and you are asked to write the function definitions in the space provided below.
#include
#include
using namespace std;
void input(int &, int &);
string process(int, int):
int main()
int…
Programing Language: C++
Your time machine is capable of going forward in time up to 24 hours. The machine is configured to jump ahead in minutes. To enter the proper number of minutes into your machine, you would like a program that can take a start time (in hours, minutes, and a Boolean indicating AM or PM) and a future time (in hours, minutes, and a Boolean indicating AM or PM) and calculate the difference in minutes between the start and future time.
A time is specified in your program with three variables:
int hours, minutes;
bool isAM; // You can also use a char, i.e. A or P
for example, to represent 11:50 PM, you would store:
hours = 11,minutes = 50, isAM = false or if using a char, hours = 11,minutes = 50, isAM = 'A'
This means that you need six variables to store a start and future time.
Write a program that allows the user to enter a start time and a future time. Include a function named computeDifference that takes the six variables as parameters that represent the start…
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
- Mark the following statements as true or false: a. To use a predefined function in a program, you need to know only the name of the function and how to use it. (1) b. A value-returning function returns only one value. (2, 3) c. Parameters allow you to use different values each time the function is called. (2, 7, 9) d. When a return statement executes in a user-defined function, the function immediately exits. (3, 4) e. A value-returning function returns only integer values. (4) f. A variable name cannot be passed to a value parameter. (3, 6) g. If a C++ function does not use parameters, parentheses around the empty parameter list are still required. (2, 3, 6) h. In C + + , the names of the corresponding formal and actual parameters must be the same. (3, 4, 6) i. A function that changes the value of a reference parameter also changes the value of the actual parameter. (7) j. Whenever the value of a reference parameter changes, the value of the actual parameter changes. (7) k. In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function. (9) l. Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided. (10) m. In a program, global constants are as dangerous as global variables. (10) n. The memory for a static variable remains allocated between function calls. (11)arrow_forward(Physics) Coulomb’s Law states that the force, F, acting between two electrically charged spheres is given by this formula: F=kq1q2r2 q1isthechargeonthefirstsphere.q2isthechargeonthesecondsphere.risthedistancebetweenthecentersofthetwospheres.kisaproportionalityconstant. Write an assignment statement to calculate the force, F.arrow_forward(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.arrow_forward
- Complete the following program When a machine reads blood pressure from a human body it displays two numbers they are called Systolicand Diastolic pressures. The program will take systolic and diastolic reading as input from the user and displays a message whether the person's blood pressure is "Normal" or "Elevated" or "High Blood Pressure". Program consists of two functions as follows. void input( .): This function is with two pass by reference parameters, and it reads input from the user. string process..): It receives two numbers(systolic and diastolic) and then it determines and returns a category according to the table below. Systolic |80 to 120 | 120 to 139 High blood equal and above 140 Diastolic Category Normal and 60 to 80 Elevated and 80 to 90 pressure above 90 or main () program is given below and you are asked to write the function definitions in the space provided below. #include #include using namespace std; void input(int &, int &); string process(int, int); int main()…arrow_forwardCalculate Caloric Intake Learning Objective: In this lab, you will practice Functions and test functions Lists Printing If statements Instructions: Main Idea The Basal Metabolic Rate (BMR) is the amount of energy (calories) your body needs while resting. This accounts for about 60 to 70 percent of calories burned in a day. In general, men have a higher BMR than women. One of the most accurate methods of estimating your basal metabolic rate is the Harris-Benedict formula: Adult_Male_BMR = 66 + (6.3 x bodyweight in lbs.) + (12.9 x height in inches) - (6.8 x age in years) Adult_Female_BMR = 655 + (4.3 x weight in lbs.) + (4.7 x height in inches) - (4.7 x age in years) In this lab, you will be given the function calculate_calorie_intake and you will be required to write the body of the test functions test_calculate_calorie_intake_negative, test_calculate_calorie_intake_1, test_calculate_calorie_intake_3. In these functions, you will write function calls to calculate_calorie_intake…arrow_forwardIn C++ Important Coding Guidelines: Use comments, and whitespaces around operators and assignments. Use line breaks and indent your code. Use naming conventions for variables, functions, methods, and more. This makes it easier to understand the code. Write simple code and do not over complicate the logic. Code exhibits simplicity when it’s well organized, logically minimal, and easily readable. Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.arrow_forward
- What is the difference between preincrementing and postincrementing a variable?arrow_forwardConvert radians into degrees Write a function in Python that accepts one numeric parameter. This parameter will be the measure of an angle in radians. The function should convert the radians into degrees and then return that value.arrow_forwardc++ pleasearrow_forward
- joyce farrell solutions, do u have the programming exercise answers/ debugging exercises ? 9th edition example : "Write a program that declares a variable named inches, which holds a length in inches, and assign a value. Display the value in feet and inches; for example: 86 inches is 7 feet and 2 inches. Be sure to use a named constant where appropriate."arrow_forwardComplete the following program When a machine reads blood pressure from a human body it displays two numbers they are called Systolic and Diastolic pressures. The program will take systolic and diastolic reading as input from the user and displays a message whether the person's blood pressure is "Normal" or "Elevated" or "High Blood Pressure". Program consists of two functions as follows. vold input .: This function is with two pass by reference parameters, and it reads input from the user. string process( .): It receives two numbers(systolic and diastolic) and then it determines and returns a category according to the table below. Diastolic and 60 to 80 and 80 to 90 Category Systolic Normal 80 to 120 Elevated 120 to 139 High blood equal and pressure above 140 above 90 orarrow_forward# Python 3 def printFunction(num1, num2): num3 = num1 + num2 return num3print(num3) Explanation: Here, num3 is the local variable that is defined in the scope of the function and when it is used outside the function, an error occurs. Print(num3) is the statement which is outside the scope of the function. So, when this statement is executed, there is no variable named num3 to be printed, so it gives an error. The error that occurs is : NameError: name 'num3' is not defined Construct a function that takes an argument. Give the function parameter a unique name. Show what happens when you try to use that parameter name outside the function. Explain the results. Show what happens when a variable defined outside a function has the same name as a local variable inside a function. Explain what happens to the value of each variable as the program runs.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning