Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 4, Problem 19RQ
Program Plan Intro
To find expression from the given expression which hasa condition, that the value of itemNumber is 5 and the value of zoneis 1 or 3 and price after adding tax.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write a C++ program for STC company , that asks the user to enter his "Neqaty" points and his
invoice value ,then display the updated invoice value according to the following condition:
Neqaty points
Bonus
Less than 400 points
-50 SA
Between 400 and 899 points
-200 SR
Greater than 900 SR
-500 SR
Example:
Enter your Neqaty points: 350
Enter your invoice value : 755
Your updated invoice value is: 705 SR.
Write a set of functions that calculate the cost of movie tickets for a family. These functions should use a pass-by-reference variable that accesses the double running_total variable in main().
Using a loop, keep displaying the ticket prices for each age group:
Something like:
Model Hall Movie Ticket Box Office
Under Age 3 (free)
Ages 3-11 ($10.25)
Ages 12-54 ($15.50)
Age 55 or older ($12)
If 4 tickets are purchased (not counting under age 3) then 20% discount
Within the loop:
Keep asking the user to input the moviegoer age and to enter a zero for the age when they are finished inputting all the family members.
Also, within the loop:
Keep a running_total that is output to the screenafter each age has been entered.
This running_total should be accessed through the functions using apass-by-reference variable.
Finally, after the looping is done:
Calculate the total cost, including a 7.5% sales tax, and output it to the screen.
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>…
Chapter 4 Solutions
Microsoft Visual C#
Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - Prob. 3RQCh. 4 - If the following code segment compiles correctly,...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - Which of the following expressions is equivalent...Ch. 4 - Which of the following expressions assigns true to...
Ch. 4 - Which of the following expressions is equivalent...Ch. 4 - How many case labels would a switch statement...Ch. 4 - Prob. 13RQCh. 4 - Prob. 14RQCh. 4 - Which of the following is equivalent to the...Ch. 4 - Which of the following C# expressions is...Ch. 4 - Which of the following C# expressions means, If...Ch. 4 - Prob. 18RQCh. 4 - Prob. 19RQCh. 4 - Which of the following C# expressions results in...Ch. 4 - Write a program named CheckCredit that prompts...Ch. 4 - Write a program named Twitter that accepts a users...Ch. 4 - Write a program named Admission for a colleges...Ch. 4 - The Saffir-Simpson Hurricane Scale classifies...Ch. 4 - a. Write a program named CheckMonth that prompts a...Ch. 4 - Account numbers sometimes contain a check digit...Ch. 4 - Write a program named GuessingGame that generates...Ch. 4 - In the game Rock paper Scissors, two players...Ch. 4 - Create a lottery game application named Lottery....Ch. 4 - Each of the following files in the Chapter.04...Ch. 4 - In Chapter 2, you created an interactive...Ch. 4 - In Chapter 2, you created an interactive...
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
- In C++ please, using basic programming one coding The main menu should show the available options: Show the roster: Displays all the player names and jersey numbers in a numbered list. Ex: 1. Susan Martinez (33), 2. Jake Smith (21), etc. Add a player: Prompts the user to type the player's full name and jersey number. Then adds the player to the roster. Remove a player: Displays the roster and prompts the user to enter the number of the player to remove. Then removes the player from the roster. Quit: Quits the program. The program should display the main menu after the user shows the roster, adds a player, or removes a player. The program only terminates when the user chooses the quit option. Data validation should be used where appropriate. Ex: The user should not be able to choose an option that doesn't exist or delete a player that doesn't exist. The roster should be kept in alphabetic order by the players' full names. Ex: If Alice Chang (9) is added to a roster with Jake Smith and…arrow_forwardProblem 7arrow_forwardPlease use C# for this. Thank you soo much!arrow_forward
- Write in c++ languagearrow_forwardIn what situation should you overload the = operator?arrow_forwardPlease due in C++ The user should give the company name and numbers. If possible can you give a comment on the code please and thank you A sample run is as follows: Enter the company name: TC Energy Enter TC Energy's stock symbol: TRP.TO Enter TC Energy's current stock price: 55 Enter TC Energy's annual dividend per share: 3.24 Enter the company name: Canadian Utilities Enter Canadian Utilities's stock symbol: CU.TO Enter Canadian Utilities's current stock price: 31.70 Enter Canadian Utilities's annual dividend per share: 1.76 Enter the company name: Bank of Nova Scotia Enter Bank of Nova Scotia's stock symbol: BNS.TO Enter Bank of Nova Scotia's current stock price: 70.08 Enter Bank of Nova Scotia's annual dividend per share: 3.60 Enter the company name: TransAlta Renewables Enter TransAlta Renewables's stock symbol: RNW.TO Enter TransAlta Renewables's current stock price: 21.75 Enter TransAlta Renewables's annual dividend per share: 0.94…arrow_forward
- Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awareded as follows: If a customer purchases 0 books, he or she earns 0 points. If a customer purchases 1 book, he or she earns 5 points. If a customer purchases 2 books, he or she earns 15 points. If a customer purchases 3 books, he or she earns 30 points. If a customer purchases 4 or more books, he or she earns 60 points. Creat an application in C# that lets the user enter the number of books that he or she has purchased this month and displays the number of points awarded.arrow_forwardCould you write function comments for def quadratic(a,b,c,x) And def print_quad(a,b,c,x) Please follow the comment rule.arrow_forwardStarting Out With Visual Basic 8th edition chapter 6 #1 made in visual studio 2017 Retail Price CalculatorWrite an application that accepts from the user the wholesale cost of an item and itsmarkup percentage. (For example, if an item’s wholesale cost is $5 and its retailprice is $10, then the markup is 100%.)The program should contain a function named CalculateRetail that receives thewholesale cost and markup percentage as arguments, and returns the retail priceof the item. When the user clicks the Get Retail button, the program should do the following:• Verify that the values entered by the user for the wholesale cost and the markuppercent are numeric and not negative• Call the CalculateRetail function• Display the retail cost as returned from the functionarrow_forward
- Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar variable that performs the following operations:arrow_forwardJacobsthal numbers are an integer sequence, where the nth Jacobsthal number can be defined as follows: 0 -- {₁-1+2√₁ Jn=" if n = = 1; if n = 2; Jn-1+2Jn_2 if n>2. Complete the print_jacobsthal_numbers () function that takes an integer parameter number_of_terms specifying the number of Jacobsthal numbers the function needs to print. You can assume that number_of_terms will always be an integer that is 1 or more. The function should print the specified number of Jacobsthal numbers on a single line with each Jacobsthal number separated by a ", ". Some examples of the function being called are shown below. For example: Test Result print_jacobsthal_numbers (3) 0, 1, 1 print_jacobsthal_numbers (5) 0, 1, 1, 3, 5 Answer: (penalty regime: 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 %) Reset answer 1 def print_jacobsthal_numbers(number_of_terms): ▼arrow_forwardIn physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:KE=12mv2The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Write a function named kinetic_energy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Write a program that asks the user to enter values for mass andvelocity, then calls the kinetic_energy function to get the object’s kinetic energy.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 Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning