Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. SpaceTicket.java LTCTasses Requirements: The purpose es the ticket of thi pom is to accept coded space ticket information as input then ote that taory,

image text in transcribed
. SpaceTicket.java LTCTasses Requirements: The purpose es the ticket of thi pom is to accept coded space ticket information as input then ote that taory, time, date, and seat, followed by the description of the gits for price have an implied decimal point. The program should propriate: 25%for nation including the actual cost, which s the price with discount applied ent ticket (s), 35% for child ticket (c), and none for regular tickets rc) The last line of the ticket should contain a "prize number" between I m cusive that should always be printed as 6 digits (e- g. 1 should be printed as 000001). The coded input is formatted as follows: 12579500s15300701209817DSpacex-001 Earthhe code) date ticket description (goes through last character in the code) seat time price [12579500 has an implied decimal point for 125795.00) s, e, or anything else is a regular ticket with no discount; store this as type char] itespace (e.g., spaces or tabs) before or after the coded information should be disregarded. (Hint: After the ticket code has been read in as a String, it should be trimmed.) Your program will need to print the ticket description, the date and time, seat, the ticket price, the ticket category, the actual cost, and a random prize number in the range I to 999999. If the user enters a code that does not have at least 25 characters, then an error message should be printed. [The 25th character of the code is part of the ticket description.] Design: Several examples of input output for the program are shown below Program output Enter ticket code: Invalid ticket code Ticket code must have at least 25 characters Note that the ticket code below results in the indicated output except for the prize number which item is shown on the same line (eg, date, time, and seat on line between them (do not use the tab es cape sequence lt). 4), there are three spaces Enter ticket code: 125795 Space Tickets SpaceX-001 Earth Datet 07/01/2098 Tine: 15:30 Price: $125,795.00 Category: nt: 17D Prize Number: 174889 Cost: $125,795.00 Page 3 of 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

4. Describe the factors that influence self-disclosure

Answered: 1 week ago

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago