EBK C PROGRAMMING:
8th Edition
ISBN: 9780357156025
Author: Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
error_outline
This textbook solution is under construction.
Students have asked these similar questions
Airline companies apply baggage restrictions for their passengers. An
airline company has decided to apply a 10kg limitation for
passengers' hand luggage and 20kg for their normal baggage. When
passengers arrive, they enter their hand and normal luggage weight
from the keyboard. If passengers exceed their normal baggage
allowance of 10 dollars per gram, they pay 12 dollars per kg.
Accordingly, write the program that calculates the baggage price of
the airline they will go to according to the baggage values entered by
the arriving passenger and keeps this from closing the program for
each passenger. Note: If hand and normal baggage allowances are
stretched below the maximum value, the payment amount will be
considered not negative. An example printout is given on the right.
Geri bildirim gönder
do it fast
Coral Help
Write a program that takes a date as input and outputs the date's season. The input is an integer to represent the month and an integer to represent the day.
Ex: If the input is:
4 11
the output is:
spring
In addition, check if both integers are valid (an actual month and day).
Ex: If the input is:
14 65
the output is:
invalid
The dates for each season are:spring: March 20 - June 20summer: June 21 - September 21autumn: September 22 - December 20winter: December 21 - March 19
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
- Develop a program that1- Would read an input from the keyboard. The input should be a whole positive number.2- Then display each digit, starting with the rightmost digit.3- At last, decide if the number if divisible by 9 or not.a. Calculate and display the sum of the digits.b. Display whether the input number is divisible by 9 or not.4- Ask the user if they would want to evaluate another number. Repeat the program if the answer is yes. Abort if they’re done.arrow_forwardGiven the sample code above in generating a random number. Create a program 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 is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) 13. The computer's choice is displayed. 4. A winner is selected according to the following rules: a. If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) b. If one player chooses scissors and the other player chooses paper, then scissor wins. (Scissors cuts paper.) c. If one player chooses paper and the other player…arrow_forwardHELP ME WRITE THIS CODEarrow_forward
- Write a program that inputs year and month number, it then display the number of days in that month for example if user enters 2020 in year and 3 in monthNumber the program should display “March 2020 has 31 days”.arrow_forwardA parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $1 per hour for each hour or part thereof over four hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that will calculate and print the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format, and should calculate and print the total of yesterday's receipts. The program should use the function calculate Charges to determine the charge for each customer.arrow_forwardC Program Write a program that will accept 2 integers. Determine and print the higher number and the lower number. If the two numbers are equal, print the message "The two integers are equal."arrow_forward
- 1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25, get the length and breadth from the user and calculate the area of rectangle. [ Area of rectangle = length * breadth ] If the input is 40, get the side from the user and calculate the area of square. [ Area of square = side * side] If the input is 65, get the radius from the user and calculate the area of circle. [ Area of circle = 3.14"r*r] Otherwise Display Enter number 25 or 40 or 65. 2. Use while loop to print the even numbers from 100 to 50. Print the product of all the even numbers.arrow_forward] In a triangle, the sum of the lengths of any two sides is greater than the lengthof the other third side. Write a program triangle.cc that prompts a user to enterthe lengths of three sides, checks if they form a triangle, and outputs if it is an isosceles,equilateral, scalene, or right triangle. Also, your program should output the perimeter andthe area of the triangle. In a right triangle, the square of the length of one side is equalto the sum of the squares of the lengths of the other two sides. An isosceles triangle hastwo sides of equal length. An equilateral triangle has all three sides with the same length.A scalene triangle has no equal sides. Your program should define and use the followingfunctions:(a) isTriangle - takes the 3 sides of a triangle and returns true if they form a triangle,false otherwise.(b) isIsosceles - takes the 3 sides of a triangle and returns true if they form anisosceles triangle, false otherwise.(c) isEquilateral - takes the 3 sides of a triangle and…arrow_forward2. Develop a program which allows the user (Student) to enter three marks. The program determines the maximum of the three marks and then displays a message based on the folowing table: |Range of Marks Message to be displayed Enter three marks which are below 70 Got Fail Enter three marks which are above 90 Got S Grade Enter three marks which are above 80, but Got A Grade less than 91 Enter three marks which are above and Got B Grade equal to 70, but less than 81 Maximum mark range is 100 Implement the above program using friend class concept.arrow_forward
- Q1: Write a program that determines whether the input year is Leap or Simple, Where the leap year is the year that is divisible by 4 and will not be a leap if it is divisible by 100 or not divisible by 400. Q2: Write a program to print the number of days of the input month number. Q3: Write a program that inputs the month number and prints the name of the month.arrow_forward6. A palindrome is a number or text phrase that reads the same backwards or forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads a 5 digit integer and determines whether it is a palindrome. Hint: One way to do this is to use division (/) and modulus (%) operators to separate the number into individual digits.arrow_forwardCan you use Python programming language to to this question? Thanksarrow_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 Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY