Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey there, I need help with my Java course homework, only stage 1 is needed at the moment (deadline is on the 24th) If the

Hey there, I need help with my Java course homework, only stage 1 is needed at the moment (deadline is on the 24th) If the whole homework could be provided before then that'd be amazing, if not then I only need Stage 1 for now and you can leave the rest, just write the proposal. Thanks! Here are the requirements: 1. Introduction

An object-based application is an application that involves objects created out of classes. These objects interact with each other to fulfill certain functionalities.

The focus of this project is to develop an application written in java which involves the use of object oriented programming. This project is a group project. As a student you will be given a chance to come up with an idea for your project. However, the project must satisfy the reequipments given in this document.

This document shall be used as a set of guidelines. You are allowed to make necessary additions and/or changes to the requirements with prior approval from your instructor.

2. Requirements

Propose and implement an application, that contributes to solving a real life problem. Your application should include at least the following:

2.1 Classes

3 to 4 classes each one of them should have:

A number of private and public attributes. The private attributes (variables) will need corresponding set/get methods.

2 or more constructors, one of then should take all the classs data members (attributes) as arguments.

Some functionality methods that can demonstrate the relationship between different classes. For example, assume that we have a system for a hotel, where a costumer can book a room. Each costumer has an ID (private) and a name. Each room has a number and price. The relationship between the Customer class and the Room class is books as illustrated in the following class diagram: image text in transcribed

This relationship should be implemented in the Customer side as a method that takes a Room object as an argument, so when a customer books a room, the room object will be stored for example in an ArrayList or a file in case if the customer is allowed to book more than one room.

Each class should have a printDetails method that will print out to the user the details of an object .

One Main (Test) class to create objects out of the classes in your application, and to demonstrate the interaction between these objects

2.2 Objects

In the Main (Test) class create at least 3 objects out of each class using different constructors.

After creating the objects, show how could you read or change the values of the private attributes.

Demonstrate the interaction (relationships) between these created objects. For example, assuming that you have created a customer object (c1) and a room object (r1), you can use the method books to book r1 for c1 as follows:

c1.books(r1);

Make a demo that shows the details to the user for each created object.

2.3 Files and Arrays

When you create an object in the Test class, read the values of the object variables from the user (e.g., the value of an ID).

After creating the objects store them temporally in an array (ArraList preferable). Then store them permanently in a file.

When printing out the detail for an object read them from that file.

2.4 Input Validation

Apply input validation where needed , for example , in the example given above, the price of a room should not be a negative value, or you cant have two customers with the same ID.

2.5 Inheritance (optional)

Apply the inheritance in your application where possible.

3. Project Stages

Stage 1 (Only this is needed for now)

A written proposal explaining the problem that you are solving, your application, how many classes in it, and how these classes will interact with each other. Use Diagrams where possible.

Stage 2

Upon approval of your proposal, submit a class diagram showing the classes, their data members, methods, and relationships between the classes.

Stage 3

The final submission of your code and output (Screenshots). (A recorded demo video will be a great idea)

Stage 1 Example: image text in transcribed image text in transcribed As I said earlier, only Stage 1 is needed for now. I will surely come back to Chegg and ask for help with the rest. For now, only the proposal is needed. I put the entire requirements just to get a clue of this project. Please provide the proposal before the 24th of Jan. I really appreciate it and thanks! (Please do not use the example I posted and write a proposal for it... Provide me with a new one. As I have posted this question and the Expert provided me with the same example I gave them, Quite ironic..)

\begin{tabular}{|l|} \hline \multicolumn{1}{|c|}{ Customer } \\ \hline - ID: String \\ + name: String \\ \hline + printDetails(): void \\ \hline \end{tabular} \begin{tabular}{|l|} \hline \multicolumn{1}{|c|}{ Room } \\ \hline+ No: int \\ + regularPrice: double \\ \hline \end{tabular} 1.1 Problem Description A lot of people who want to visit the smart city are suffering to buy the tickets and to get information about the events in the smart city, where they have to go a long way to buy the tickets. Then they find out that all tickets are sold out or event's time isn't appropriate for them, so will waste their time and money. 1.2 Application Description Smart city application: - Helps the visitors to reserve tickets from the application without going a long way to reserve them. - In the beginning, the program will welcome visitors to the smart city. - Then the program will display the basic entry ticket to the visitors, including its price, and let them book the number of tickets they want for their families. - And the reservation will be recorded with the name entered by the visitor. - After that, the program will display the events in the smart city to the user, including their time, date, and price. - The visitor is free to add the events to his basic ticket. - Finally, the program will display the whole ticket as a receipt, including the event's scheduled time and price. 1.3 Classes and Relations We will use 3 classes: visitors class, events class and receipt class. - The visitor class: will display the primary ticket and its price to the visitors and let them reserve the number of tickets they need for their families. Then the ticket's information will be sent to the receipt class. - The events class: will display the available events in the smart city, including its information such as its time and price, then let the visitors choose the events they want to add to their main ticket. Then the class sends the ticket's information to the receipt class. - The receipt class: will hold the ticket's information from the visitor and events class. Then will display the whole ticket's information to the visitor, including the events he added and their time, total price, and other information, and will be stored in a file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the firm's cash flow from investing?

Answered: 1 week ago