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 16RQ
Assume that you have declared a variable as double salary
Which of the following will display $45,000?
- WriteLine(salary.ToString(“c”));
- WriteLine(salary.ToString(“c0”));
- WriteLine(salary);
- Two of these
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Assume that grade is a variable whose value is a letter student_grade-- any one of the following letters:
'A', 'B', 'C', 'D', 'F". Assume further that there are the
following int variables, declared and already initialized: acount, bcount, ccount, dcount, fcount.
Write a switch statement that increments the appropriate variable (acount, bcount, ccount, etc.) depending
on the value of grade. So if grade is 'A' then acount is incremented; if grade is'B'
then bcount is incremented, and so on.
For the following code:
for ( a = 1, b = 5, c = 3; a < 4; a++, b++ )
{
c = a * b + c;
}
Indicate what values for the following variable will be when the code endsa=b=c=
Payment
=
Principal [rate ((1 + rate)months)]
[(rate + 1)months - 1]
For the formula to compute monthly payment, see Listing 2.9, ComputeLoan.java.
(Financial application: loan amortization schedule) The monthly payment for a
given loan pays the principal and the interest. The monthly interest is computed
by multiplying the monthly interest rate and the balance (the remaining princi-
pal). The principal paid for the month is therefore the monthly payment minus
the monthly interest. Write a program that lets the user enter the loan amount
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
- Assume result is an int variable. When the following statement executes, what value will be stored in result? result = (2 + 5) * 10;arrow_forwardEquality comparison operator (==) CANNOT be used to compare the values of which of the following type of variables? O String o int o double O floatarrow_forwardassign(self, assignment:Assignment) -> AssignmentResult: """ This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment…arrow_forward
- Create a flowchart for this programarrow_forwardPhython: Create a function so that when giving you a month it tells you the season of that month, for example: if it is January it will be winter.Using the def, try and except ValueError functions.arrow_forwardAssume that qty and salesReps are both integers. Use a type cast expression to rewrite the following statement so it will no longer perform integer division.unitsEach = qty / salesReps;arrow_forward
- please edit the code below to add a condition to your function . If the number of hours exceeds 40 hours then assign a 5% bonus to the wage, if it's between 30-40 assign 3% bonus to the wage. <?php function calculateWage($hours, $wage) { $wage = $hours * $wage; return $wage; } if ($_SERVER["REQUEST_METHOD"] == "POST") { $hours = $_POST['hours']; $wage = $_POST['wage']; // call the calculateWage function to get the wage $wage = calculateWage($hours, $wage); // print the result message echo "Your wage is: $" . number_format($wage, 2); // repopulate the form fields with the input values $hours = isset($_POST['hours']) ? htmlspecialchars($_POST['hours']) : ''; $wage = isset($_POST['wage']) ? htmlspecialchars($_POST['wage']) : ''; } else { // set default values for the form fields $hours = ''; $wage = ''; } ?> <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> <label for="hours">Number of Hours Worked:</label>…arrow_forwardTrace through what values are stored in each variable as the code executes and what values will be displayed. Assume the user enters Nassau, 10 in that order. county input ('Enter the county you live in: ') credits int(input ('Enter the number of credits you are taking: ')) if county 'Nassau' and credits >= 12: == tuition = 2000 elif county == 'Suffolk': tuition 3990 elif credits >= 10: tuition = credits * 160 else: tuition = credits * 30 print (tuition) county credits tuition outputarrow_forwardis an operator which can be used for checking if two values are the same.arrow_forward
- Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a VendingMachine variable that performs the following operations:arrow_forwardFor this part of the assignment, you will create functions to calculate a person's body mass index (BMI).The formula you must use for this calculation is: BMI= (weight/height * height) **************Where weight is measured in kilograms and height is measured in meters. Do This: Write two functions: bmi() and imperial_bmi() that computes and returns the body mass index (BMI) of an individual. The first function - bmi takes the height and weight using metric measurements (centimeters and kilograms) and the second function (imperial_bmi) uses imperial measurements (inches and pounds). We will be using the auto-grader for this part of the assignment so your functions must match the specs precisely.Note: The BMI (metric) formula (given above) uses meters but our function for the bmi() takes centimeters as one of its parameters: bmi(height, weight): ''' Function -- bmi Takes as input height and weight in cm and kg and returns the BMI value Parameters:…arrow_forwardPlease help me! The program is able to accept 3 input scores from the user. The average of the 3 scores can also be obtained. How do I show thw highest score and the lowest score from the 3 input scores. strictly use this program below import csv# Define global variablesstudent_fields = [' Student No.', ' Name', ' Age', ' Email address']math = ['Math']physics = ['Physics']computer = ['Computer']average = ['Average']student_database = 'students.csv' def display_menu():print(" Welcome to Student Management System ")print("1. Add New Student")print("2. View Students")print("3. Search Student")print("4. Update Student")print("5. Delete Student")print("6. Quit") def add_student():print("Add Student Information")global student_fieldsglobal mathglobal physicsglobal computerglobal averageglobal student_database student_data = []for field in student_fields:value = input("Enter" + field + ": ")student_data.append(value)for m in math:m = int(input("Enter your math grade: "))student_data.append(m)…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,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY