Lojack Airline allows a passenger only two pieces of luggage. The heavier bag can be at most 80 pounds but the total weight of the two should not exceed 100 pounds. Make a program that would input the weight of the two bags in any order and output whether the weight of the bags in any order and output whether the luggages are allowable or not. Use the output format below.
LOJACK AIRLINE
WEIGHT OF FIRST BAG :<value entered>
WEIGHT OF SECOND BAG :<value entered>
STATUS :<status>
LUGGAGE FEE :<fee>
Notes:
1. Status is either ‘WEIGHT ALLOWABLE’ or WEIGHT NOT ALLOWABLE
2. Luggage fee is
Weight Fee
Below 40 ₱10
41 to 75 ₱12
76 to 100 ₱15
Not allowable ₱0
1
Expert's answer
2012-07-26T08:49:44-0400
class Program { static void Main(string[] args) { Console.Write("LOJACK AIRLINE"); Console.Write("WEIGHT OF FIRST BAG: "); int weight1 = int.Parse(Console.ReadLine()); Console.WriteLine("WEIGHT OF SECOND BAG: "); int weight2 = int.Parse(Console.ReadLine()); if((weight1 > 80) ||(weight2 > 80) || (weight1 + weight2 > 100)){ Console.WriteLine("STATUS: WEIGHT NOT ALLOWABLE"); Console.WriteLine("LUGGAGE FEE: ₱0"); } else{ Console.WriteLine("STATUS: WEIGHT ALLOWABLE"); if(weight1+weight2 <= 40) Console.WriteLine("LUGGAGE FEE: ₱10"); else if (weight1+weight2 <= 75) Console.WriteLine("LUGGAGE FEE: ₱12"); else Console.WriteLine("LUGGAGE FEE: ₱15"); } } }
Comments
Leave a comment