Assignment 01 (lab).docx

# Length and width in meters of a rectangle and the

• Homework Help
• 8

This preview shows pages 3–5. Sign up to view the full content.

* length and width (in meters) of a rectangle and the price of a * square meter of tile. The program should display the area of * the rectangle and the total cost of the tile. * calculation: * area = length * width = 5 * 4 = 20 * cost = area * price = 20 * 2 = 40 */ ANSWER: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console; namespace compp100 { class Program { static void Main(string[] args) { double A; double cost; Console.Write("input the length of tile in meters:"); double length = Convert.ToDouble(Console.ReadLine()); Console.Write("input the width of tile in meters: "); double width = Convert.ToDouble(Console.ReadLine()); Console.Write("input the price of tile per square meter:"); double price = Convert.ToDouble(Console.ReadLine()); A = length * width; cost = A * price; Console.WriteLine("Area of the floor is " + A); Console.WriteLine("total cost of tile " + cost); Console.ReadLine(); } } }

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

3. The Happy Yappy Kennel boards dogs at a cost of 50 cents per pound per day. Write a program named DogBoarding that prompts a user for and accepts a dog’s weight and number of days to be boarded. Then, display the total price for boarding.
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