60 583
Assignments Done
Successfully Done
In April 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:


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

STATUS :<status>
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("LOJACK AIRLINE"+"\n");
Console.WriteLine( "WEIGHT OF FIRST BAG " + first);
Console.WriteLine("WEIGHT OF SECOND BAG " + second);
Console.WriteLine("STATUS " + ((allowable) ? "allowable" : "not allowable"));
& }

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions