Assignment 01 (lab).docx

Then display the total price for boarding answer

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

View Full Document Right Arrow Icon
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());
Image of page 4

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

View Full Document Right Arrow Icon
price = days * weight * 0.50; Console.WriteLine("total price for boarding :"+price); Console.ReadLine(); } } }
Image of page 5
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(); } } }
Image of page 6

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

View Full Document Right Arrow Icon
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("*******************************");
Image of page 7
Console.WriteLine("The sum is:"+payroll); Console.ReadLine(); } } }
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern