Question

A new city “Ballymanus” has been announced in a state in Australia and the state government...

A new city “Ballymanus” has been announced in a state in Australia and the state government has planned to extend the public transport where the fares will be calculated according to the existing fare rule of the state. As per the existing fare system, everyone must have to buy the “Move Card” in order to travel on trains, tram, and buses in different parts of the state, including the new city. There are 2 options in “Move Card”  “Move Money”: When you travel occasionally, you can use a “Move Money”. You need to load an amount onto your “Move Card” and it will automatically calculate the lowest fare possible as you touch on and touch off. The fare for the Move Money is given in the following table: CRICOS Provider No. 00103D Page 2 of 5 Table 1 Move Money Daily Fare Fare Type Weekdays (Daily) Weekends (Daily) Full fare $8.80 $6.40 Concession $4.40 $3.20  “Move Pass”: If you travel often, you can use a “Move Pass” and you’ll need to select the number of consecutive days you travel when you buy it. You can buy a Move Pass for 7 days or anywhere between 28 and 365 days. The fare for the Move Pass is given in the following table: Table 2 Move Pass Fare Fare Type Weekly rate (7 days pass) Daily rate for 28-365 days Full fare $44.00 $5.30 Concession $22.00 $2.65 Travelers might need a calculator to work out how much their journey will cost and to find the most costeffective way for them to travel using “Move Card”. You have been assigned to design and develop a small console CALCULATOR program to help the travelers, enabling them to find the appropriate option (“Move Pass”/”Move Money”) and to calculate the traveling cost. Once a calculation is processed, the program will return to the initial condition and will be ready to commence another calculation. The CALCULATOR program should be able to input the following options:  Fare type: 1 OR 2 (1= Full fare, 2= Concession)  Number of days to travel on weekdays: a number between 0 and 5  Number of days to travel on weekends: a number between 0 and 2  Number of weeks you are planning to travel: a number between 1 and 52 The CALCULATOR will display the following output based on the input provided by the user:  The amount in “Move Money”  The amount in “Move Pass”  And a Recommendation on which option should be cost effective for the user CRICOS Provider No. 00103D Page 3 of 5 The system should be flexible so that the state government can include new fare types (e.g., student pass) and the concept of varying fares for different zones (e.g., Zone 1, Zone 2, a combination of multiple zones) at a later date without having to rewrite the entire program. This means you will need to use an interface for processing total fares, and polymorphism for the various fare type classes, so that new and different fare types may be added at a later date with minimal updates to the code. You are asked to provide with some documentation before you commence coding so that the client (the state government) is able to verify that the program you intend to code will address their requirements. The client would like to see the use cases to summarize the requirements in written format, as well as use case diagrams, class diagrams, and sequence diagrams. * For verifying the program, two sample input-outputs are given at the Appendix section Submission You are required to submit the assignment before the due date consisting of:  A Zip file containing the following (submitted via Moodle under the Assignment 1 link) o A written report comprising:  Use Cases summarizing the requirements  UML Diagrams, created in Enterprise Architect, comprising:  a Use Case Diagram for processing the calculation  a Class Diagram of the intended system  a Sequence Diagram for processing the calculation  A short reflection (approximately 200-300 words) of what you have learned, if anything, on this assignment, particularly relating to requirements design and analysis, UML diagrams and object-oriented programming with interfaces and polymorphism. As an example, if you found that you changed your initial UML diagrams after you had commenced coding, you should explain what these changes were and explain what you learned that led to these changes. o Enterprise Architect file(s) containing your UML Diagrams for the Use Case, Class and Sequence Diagrams o Your finished program (in any OOP language), addressing the requirements outlined in the Assignment Details.

please provide the UML diagram

no UML diagrame is not provided
0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per given data wrote the program as shown below

import java.util.*;        //taken from the library file
public class Main
{
static double moveMoneyFullfare [] = new double [] {8.80,6.40};
static double moveMoneyConcession [] = new double [] {4.40,3.20};//incremented values
static double movePassFullfare [] = new double [] {44.00,5.30};
static double movePassConcession [] = new double [] {22.00,2.65};
   public static void main(String[] args) {        //open the start instruction
       Scanner sc = new Scanner(System.in);
       int fareType,weekdays, weekends,weeks;

//representing the type and the week days and week ends
       System.out.println("Fare type: 1 OR 2 (1= Full fare, 2= Concession)");//print instruction
       fareType = sc.nextInt();
System.out.println("Number of days to travel on weekdays: a number between 0 and 5");
weekdays = sc.nextInt();
System.out.println("Number of days to travel on weekends: a number between 0 and 2");//print insrution
weekends = sc.nextInt();
System.out.println("Number of weeks you are planning to travel: a number between 1 and 52");
weeks = sc.nextInt();
  
double fullFare = calculeteFareForFullFare(weekdays, weekends,weeks);
double concession = calculeteFareForConcession(weekdays, weekends,weeks);
if(fareType == 1)
System.out.println("You chose full fare.\nYour total fare = $"+fullFare);//representing system output print
else
System.out.println("You chose concession fare.\nYour total fare = $"+fullFare);
  
System.out.println("The recommendation option for cost effective fare for the user : " + (fullFare<concession?"Full Fare i.e $"+fullFare:"Concession i.e $"+concession));
   }
  //closing of instruction loop
   public static double calculeteFareForFullFare(int weekdays, int weekends, int weeks){
   double fare = 0;
   fare+=moveMoneyFullfare[0]*weekdays;
   fare+=moveMoneyFullfare[1]*weekends;
   if(weeks<=4)
   fare+=movePassFullfare[0]*weeks;
   else
   fare+= (movePassFullfare[0]*4) + (movePassFullfare[1]*((weeks-4)*7));
   return fare;//it will not return the fare
   }//closing of instruction
  
   public static double calculeteFareForConcession(int weekdays, int weekends, int weeks){
   double fare = 0;
   fare+=moveMoneyConcession[0]*weekdays;
   fare+=moveMoneyConcession[1]*weekends;
   if(weeks<=4)
   fare+=movePassConcession[0]*weeks;//representing adddtion and multiplication
   else
   fare+= (movePassConcession[0]*4) + (movePassConcession[1]*((weeks-4)*7));
   return fare;
   }//closing of instruction loop
}//closing of instruction loop

UML DIAGRAM

Add a comment
Know the answer?
Add Answer to:
A new city “Ballymanus” has been announced in a state in Australia and the state government...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A new city “Ballymanus” has been announced in a state in Australia and the state government has planned to extend the public transport where the fares will be calculated according to the existing fare...

    A new city “Ballymanus” has been announced in a state in Australia and the state government has planned to extend the public transport where the fares will be calculated according to the existing fare rule of the state. As per the existing fare system, everyone must have to buy the “Move Card” in order to travel on trains, tram, and buses in different parts of the state, including the new city. There are 2 options in “Move Card”  “Move...

  • Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented...

    Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented design by creating an UML diagram for a Java program. Program Statement: Bank System You were asked to create a simple UML diagram for a bank system. Each bank has a specific identification number, a name, and a location that needs to be stored. Tellers serve customers’ loans, checking and savings accounts. The bank must know each tellers’ name and identification number for record...

  • CIS 221 Loan Calculator Enhancement Introduction You are a systems analyst working for a company that...

    CIS 221 Loan Calculator Enhancement Introduction You are a systems analyst working for a company that provides loans to customers. Your manager has asked you to enhance and correct their existing Loan Calculator program, which is designed to calculate monthly and total payments given the loan amount, the annual interest rate, and the duration of the loan. Although the current version of the program (hereby termed the “As Is” version) has some functionality, there are several missing pieces, and the...

  • Due to your experience in designing the database for the "Legendary League" game, you have been...

    Due to your experience in designing the database for the "Legendary League" game, you have been asked to design the ER diagram for a bigger database to manage the events for the "Legendary League" eSports Oceanic Championship (OC). The requirements are as follows: Registered teams compete in the OC. Each team has a name, and a number of team members. A team also maintains a rank throughout the OC, reflecting how well it is doing in the championship. Team members...

  • Using Java You are helping a corporation create a new system for keeping track of casinos...

    Using Java You are helping a corporation create a new system for keeping track of casinos and customers. The system will be able to record and modify customer and casino information. It will also be able to simulate games in the casino. Customer-specific requirements You can create new customers All new customers have a new customerID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect. New customers have names and monetary...

  • (d)analysis document dynamics model(interaction, state and activity) please make sure image is clear and/or writing is...

    (d)analysis document dynamics model(interaction, state and activity) please make sure image is clear and/or writing is legible Objective You are asked to create and design an UML model, to take care of work flow of a University. Your Model should take care of all unknown data, which are important for decision-making. Your computer based UML has to be able to show all necessary requirements through UML simulations. You are not required to design any hardware or apply that model to...

  • Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance...

    Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance and interface behaviors . The link to the PDF of the diagram is below MotorVehical.pdf Minimize File Preview User Define Object Assignment: Create a Intellij Project. The Intellij project will contain three user defined classes. The project will test two of the User Define Classes by using the invoking each of their methods and printing the results. You are required to create three UML...

  • Project overview: Create a java graphics program that displays an order menu and bill from a...

    Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...

  • The main method of your calculator program has started to get a little messy. In this...

    The main method of your calculator program has started to get a little messy. In this assignment, you will clean it up some by moving some of your code into new methods. Methods allow you to organize your code, avoid repetition, and make aspects of your code easier to modify. While the calculator program is very simple, this assignment attempts to show you how larger, real world programs are structured. As a new programmer in a job, you will likely...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT