63 146
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #12060 in C# for Sophia

Question #12060
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 exceeed 100 pounds.Please help me create a program that would input the weight of the two bags in any order and output whether the weight of the two bags in any order and output whether the luggages are allowable or not. This is the output format:

LOJACK AIRLINE

WEIGHT OF FIRST BAG :<value entered>
WEIGHT OF SECOND BAG :<value entered>

STATUS :<status>
LUGGAGE FEE :<fee>
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TEMP
{
class Program
{
& static void Main(string[] args)
& {
Console.Write(" Enter weight of first bag: ");
double first = Convert.ToDouble(Console.ReadLine());
Console.Write("Enter weight of second bag: ");
double second = Convert.ToDouble(Console.ReadLine());
bool allowable = false;
if ((first<80) && (second<80) && (first+second<100)){
allowable = true;
}


Console.WriteLine();
Console.WriteLine("LOJACK AIRLINE"+"\n");
Console.WriteLine( "WEIGHT OF FIRST BAG " + first);
Console.WriteLine("WEIGHT OF SECOND BAG " + second);
Console.WriteLine();
Console.WriteLine("STATUS " + ((allowable) ? "allowable" : "not allowable"));
Console.ReadLine();
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions