In this homework, the student will demonstrate the ability to: 1. Create a function 2. Call a function Read chapter 6 and PowerPoint for chapter 6 carefully. Watch the following video that solves a...

1 answer below »
these are two more overdue assignments that i need help on


In this homework, the student will demonstrate the ability to:   1. Create a function 2. Call a function Read chapter 6 and PowerPoint for chapter 6 carefully.   Watch the following video that solves a problem using methods.   Rectangle Calculations   https://www.youtube.com/watch?v=D6ejMYwMnW4 Create an application that calculates the total cost of a hospital stay. The daily base charge is $350. The hospital charges for medication, surgical fees, lab fees, and physical rehab. The applications should accept the following input:   · The number of days spent in the hospital · The amount of medication charges.  Type 50.00 in the box when you run the program · The amount of surgical charges. Type 100.00 in the box when you run the program · The amount of lab fees. Type 50.00 in the box when you run the program · The amount of physical rehabilitation charges. Type 200 in the box when you run the program   You must create the following methods and call them:   · CalcStayCharges = Calculates and returns the base charges for the hospital stay. This is computed by multiplying 350 by the number of days in the hospital · CalcMiscCharges – Calculates and returns the total of the medication, surgical, lab, and physical rehabilitation charges. · CalcTotalCharges – Calculates and returns the total charges by adding the stay charges and misc charges.   Write appropriate exception handling code that prevents the user from entering bad input. Car Class   The purpose of this homework is for the student to demonstrate they can   1. Declare a class 2. Create an instance of a class 3. Call class methods 4. Manipulate properties of the class   Create a class named Car that has the following properties: Year - The Year Property holds the car’s year model Make – The Make property holds the make of the car. Speed – The Speed property holds the car’s current speed.   In addition, the class should have the following constructor and other methods. · Constructor – The constructor should accept the car’s year and model and make them as arguments. These values should be assigned to the backing fields for the object’s Year and Make properties. The constructor should also assign 0 to the backing field for the Speed property. · Accelerate – The Accelerate method should add 5 to the Speed property’s backing field each time it is called. · Brake – The Brake method should subtract 5 from the Speed property’s backing field each time it is called. Demonstrate the class in an application that creates a Car object. The application’s form should have an Accelerate button that calls the Accelerate method and then displays the car’s current speed each time the button is clicked. The application’s form should also have a Brake button that calls the Brake method and then displays the car’s current speed each time the button is clicked.   Let the user know if they have not entered a make or year by displaying a messageBox. Show current speed in a label. Make sure the speed is never a negative number by letting the user know the car is not moving if the speed is 0.   Example of form can be as followed:
Answered 1 days AfterApr 23, 2021

Answer To: In this homework, the student will demonstrate the ability to: 1. Create a function 2. Call a...

Swapnil answered on Apr 24 2021
140 Votes
Solution/1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using
System.Threading.Tasks;
namespace Hospital_Charges
{
    class Program
    {
        static void Main(string[] args)
        {
            int number_days;
            double medication_charge, surgical_charge, lab_fee, rehabilation_charge;
            double total_charge, misc_charges, stay_Charge;
            
            Console.Write("Enter number of days spent in hospital: ");
            number_days = Convert.ToInt32(Console.ReadLine());
            
            Console.Write("\nEnter amount of medication charges: ");
            medication_charge = Convert.ToDouble(Console.ReadLine());
            
            Console.Write("\nEnter amount of surgical charges: ");
            surgical_charge = Convert.ToDouble(Console.ReadLine());
            
            Console.Write("\nEnter amount of lab fees: ");
            lab_fee = Convert.ToDouble(Console.ReadLine());
            
            Console.Write("\nEnter amount of physical rehabilation charges: ");
            rehabilation_charge = Convert.ToDouble(Console.ReadLine());
            
            stay_Charge = CalcStayCharges(number_days);
            misc_charges = CalcMiscCharges(surgical_charge, lab_fee,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here