Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Introduction

A new online system for purchasing carsis being designed and you have been contracted to write a C# console application program that models the proposed functionality of this system.

AssignmentDetails

You are required to produce a program written in C#, which will model the functions of both purchasing and exchanging cars.

The program will display a list of possible actions, read in the user's choice and then perform the required action.  The user will be able to select any action from the menu and the program will be able to handle the situation.

Here is avery high-level algorithm of the assignment design:

While not finished

                Display list of possible actions

                Input the user's option

                Perform the required action

        End while

 Assignment Specification

A number of assumptions have been made so that the assignment can be completed using only the concepts covered in Lessons 1 to 4.  You are free to use any valid programming constructs even if they have not been covered in lessons so far.

Our model of a Car Purchasing System will permit the user to choose from the following main menu:

  • Obtain a price for any car type
  • Purchase any car type
  • Exchange a car owned by the user for another car
  • Exit the simulation

Seethe sample screen interactions at the end of this document for further details.

All input should be checked that it is within the acceptable range.  If input is not within the acceptable range, then the user should be informed of the range and requested to re-enter the input.

When a user chooses an action, it will affect the state of the Car Purchasing System as follows:

  • Obtain a price for any car type:(CheckPrice)
    The list of car types is displayed
    1. Sedan
    2. Coupe
    3. Ute
    4. Convertible
    5. 4WD

The user will select one of these or choose to cancel this selection

If the user has selected a car type,then the current date and time is displayed along with the price for that car.

o   The user will select one of these or choose to cancel this selection

o   If the user has selected a car type,then the current date and time is displayed along with the price for that car.

  • Purchase any car type (PurchaseCar)
    • The list of car types is displayed
    • The user will select one of these or choose to cancel this selection
    • If the user has selected a car type:
      • Prompt the user for the amount to be paid.
      • Amount to be paid needs to be:
  • a multiple of $50
  • greater than 10% of the car price - paid as a deposit to reserve the car
  • not greater than the car price
      • If the amount entered is not a multiple of $50, no transaction occurs and the user is asked to enter different amount
      • If the amount entered is not greater than 10% of the car price, no transaction occurs and the user is informed that they must pay at least 10% of the car price to reserve the car
      • If the amount entered greater than the car price, no transaction occurs and the user is informed that they cannot pay more than the car is worth
      • If the amount entered is a multiple of $50, is greater than 10% of the car price but not greater than the car price, then the user is asked for their name and a transaction occurs
  • Exchange a car owned by the user for another car (ExchangeCar)
    • Prompt the user to choose which car type they already own
    • The list of car types is displayed
    • User will select one of these or choose to cancel this selection
    • If the user has selected a car type, the user will be asked to choose which car type they would like to exchange their car for.
    • If they select a car type to exchange:
      • There is an exchange fee of $500 that is required for each exchange.
      • If the car owned by the user costs less than the exchange car plus exchange fee, the user is informed that they have insufficient credit for that transaction and no exchange occurs.
      • A summary of the exchange is displayed
  • Exit the simulation
    • A terminating message is displayed.

Some initial work had already been done on this project and the following specification of various methods has been developed and agreed upon with the client. You are required to use these methods.

void CheckPrice(int carType)

Action: Current time and date is displayed along with the price indicated by the carType.

void PurchaseCar(int carType, double amountPaid)

Action: Provided that the amount paid is greater than 10% of the car price but not greater than the car price, the car is indicated by carType is purchased.

void CarTransaction(int carType)

Action:  Displays a message consisting of the car type now owned by the user.

void ExchangeCar(int fromCar, int toCar)

Action: Provided that the car owned does not cost less than the exchange car plus exchange fee, the user exchanges one car type for another.

Assumptions

We assume the following for our simulation:

  • The system has an endless supply of cars for purchasing.
  • The user will input data values of the correct type when requested to do so. This means that if an integer is expected, then an integer value is entered.
  • The car types and default prices are listed below:

Car Type

Price

Sedan

$17,000

Coupe

$21,000

Ute

$23,500

Convertible

$27,700

4WD

$28,000

  • The car types and any constants may be class variables; all other variables are to be local variables.
  • To print the current date and time,use the following code:

DateTime date = DateTime.Now;

Console.WriteLine("Current Date: {0:f} ", date );

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9523114

Have any Question?


Related Questions in Programming Language

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As