COMP
Assignment 01 (lab).docx

# Then display the total price for boarding answer

• Homework Help
• 8

This preview shows pages 4–8. Sign up to view the full content.

be boarded. Then, display the total price for boarding. ANSWER: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console; namespace ConsoleApp2 { class Program { static void Main(string[] args) { double weight, price; int days; Console.WriteLine("weight of dog(in pounds):"); weight = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("No of days :"); days = Convert.ToInt32(Console.ReadLine());

This preview has intentionally blurred sections. Sign up to view the full version.

price = days * weight * 0.50; Console.WriteLine("total price for boarding :"+price); Console.ReadLine(); } } }
4.Create a C# program to display the following output ANSWER: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console; namespace ConsoleApp2 { class Program { static void Main(string[] args) { double number1, number2, multiply; Console.WriteLine(" please enter a number:"); number1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("enter one more number:"); number2 = Convert.ToDouble(Console.ReadLine()); multiply = number1 * number2; Console.WriteLine("multiplication of 2 numbers:"); Console.WriteLine("*****************************"); Console.WriteLine(+multiply); Console.ReadLine(); } } }

This preview has intentionally blurred sections. Sign up to view the full version.

5.Create a C# program to display the following output salary+bonus-deduction ANSWER: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console; namespace ConsoleApp2 { class Program { static void Main(string[] args) { double salaryamount,bonusamount,deduction,payroll; Console.WriteLine(" Enter salary amount:"); salaryamount = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter bonus amount:"); bonusamount = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter deduction:"); deduction = Convert.ToDouble(Console.ReadLine()); payroll = salaryamount + bonusamount - deduction; Console.WriteLine("calculated payroll amount is :"); Console.WriteLine("*******************************");
Console.WriteLine("The sum is:"+payroll); Console.ReadLine(); } } }
This is the end of the preview. Sign up to access the rest of the document.
• Fall '15
• Allan Randall
• Height, Orders of magnitude, static void Main, Tile Limited, Prince singla

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern