Question: Task 2 - CarParkingCost.java Write a program that accepts the number of hours that a car has parked in a parking lot. It will


Task 2 - CarParkingCost.java Write a program that accepts the number of hours that a car has parked in a parking lot. It will calculate and output the charge based on the following schedule: $3 per hour for the first hour $2 per hour for the next 4 hours $1 per hour for the remaining time parked The MAXIMUM daily charge is $16 input variable: int hours; output variable: int cost; calculation: hr 1 6 7 8 9 10 11 12 13 14 15 16 $ 3 5 7 9 11 12 13 14 15 16 16 16 16 16 16 16 Condition Input Expected output Real output Flowcharts and Selection hours == 1 1 $3 hours 1 && hours 5 && hours 10&& hours Task 1 Triangle.java The triangle inequality theorem states that to form a triangle, the sum of the lengths of any two sides of the triangle has to be greater than the length of the third side. Using the integer variables a, b, and c representing three side lengths as input, write a program that evaluates these values and determine if a triangle can be formed. If a triangle exists, then output if the triangle is scalene, isosceles or equilateral. Examples: Output: No triangle Input: 1, 2, 3 Input: 2, 4, 5 Output: Scalene triangle Input: 2, 2, 3 Output: Isosceles triangle Input: 2, 2, 2 Output: Equilateral triangle The triangle inequality theorem: Condition Input Expected output Real output a+b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
