QuestionQuestion

Transcribed TextTranscribed Text

The SpaceW Quotation System Assignment Briefing: The wonderful company, SpaceW, is a fictional company that makes its money by providing orbital services (aka, blasting rockets into space). Your program is to provide Quotations to potential customers detailing the services and the cost of the space mission. They have two lift vehicles Hawk-9 and Hawk Heavy. They offer a range of services including manned spaceflight at various cost levels as shown in the table below. Satellites can be launched into any orbit – but standard prices include LEO (low earth orbit) and GTO (Geosynchronous Transfer Orbit). SpaceW Launch services Service Code Description Cost US $ Notes ORBL One satellite to low earth orbit weighing less than 6 metric tonnes; or One satellite to GTO weighing less than 4 metric tonnes 62,000,000 ORBLH One satellite to low earth orbit weighing less than 26 metric tonnes; or One satellite to GTO weighing less than 18 metric tonnes 90,000,000 ORBC1U One micro satellite 10x10x10cm (cubesat size 1) Ride Sharing with another payload in a similar orbit. 500,000 *2 ORBC2U One micro satellite 10x10x20cm (cubesat size 2) Ride Sharing with another payload in a similar orbit. 1,000,000 *2 ORBC3U One micro satellite 10x10x30cm (cubesat size 3) Ride Sharing with another payload in a similar orbit. 1,400,000 *2 ORBC6U One micro satellite 10x20x30cm (cubesat size 6) Ride Sharing with another payload in a similar orbit. 2,000,000 *2 SpaceW Insurance services ILLOYDS Insurance for payload to the value of 1 Million dollars (no tax due on insurance costs) 67,200 *1 *3 LINCE Insurance for Launch ORBL 3,010,000 *1 LIHEAVY Insurance for Launch ORBLH 5,299,000 *1 LI-1 Launch Insurance for cubesat size 1 7,100 *1 LI-2 Launch Insurance for cubesat size 2 9,100 *1 LI-3 Launch Insurance for cubesat size 3 17,999 *1 LI-6 Launch Insurance for cubesat size 6 29,900 *1 PL100 Insurance for cubesat payload for a cubesat value < 100,000$ 5,000 *1 PL200 Insurance for cubesat payload for a cubesat value < 250,000$ 10,000 *1 PL500 Insurance for cubesat payload for a cubesat value < 650,000$ 30,950 *1 Note *1 Insurance costs do not incur tax *2 Free Teddy Bear *3 Payload values are rounded up to the nearest million E.g. payload value 650,001 would count as 1 million E.g. payload value 1,00,001 would count as 2 million E.g. payload value 7,250,000 would count as 8 million Additional Information: The generous ‘trumpcards’ government has deemed that a 13% of payload cost ‘earth sciences tax’ will apply to all spaceflights with payloads valued at more than 1,000,000$ that include satellites whose job it is to monitor Global Warming indicators. Promotional offer: All cubesat space flights get a custom signed space suited 3-foot-tall teddy bear free of charge. Any satellite launch that is to GTO requires rental of the Nearly Extinct Space Agency (NESA) tracking stations who charges a 120,000$ fee. There is no tax on tracking services since it helps keep space tidy and that stops Kessler Syndrome. Cubesats are assumed to go to LEO, if a cubesat needs a GTO orbit the additional cost is $300,000 and of course a NESA fee as well. Cubesats of value more than 650,000 use the standard ILLOYDS insurance for insuring payload value Payload values can be as low as 10,000 and as high as 900,000,000 The system works in whole dollars; values should be rounded to the nearest dollar. Only one of PL100, PL200, PL500 can be applied to any launch. This would be a simple assignment except for the facts: • I want all non-numeric input edited so error codes cannot be entered. • I want all input numeric fields range edited, and errors handled. For this assignment the input of non-numeric data into numeric fields won’t be tested. o E.g. we may test payload vale of ‘9000’ which would be to. low, but won’t test payload value of ‘fred’ • The program should ask different questions depending on the service chosen and the value of the payload. o For example, service ORBL with a payload value of 6,000,000 needs to ask: ▪ Orbit GTO or LEO ▪ If it’s a ‘global Warming Monitor’ ▪ If you want Payload insurance; and ▪ If you want Launch insurance o For example, service ORBL with a payload value of 900,000 needs to ask: ▪ Orbit GTO or LEO ▪ If you want Payload insurance; and ▪ If you want Launch insurance • The system must also loop – to do more than one quote in a single run, you don’t need an exit on every input – but you must have a way to cleanly leave the system, with a message “** Program ending **” or something similar. • Your program needs to clearly show the relevant insurance code (in the quote or in the input validation). Example Quote Calculation Details Value Service: ORBL Orbit: LEO Value of satellite: 3.9 million$ Global Warming Monitor: N Payload insurance N Launch Insurance Y See sample run Service ORBL 62,000,000 Orbit LEO Payload Value 3900000 Global Warming Monitor N TAX 0 Payload insurance Launch Insurance LINCE 3,010,000 NESA Fees 0 Total 65,010,000 Service: ORBLH Orbit: GTO Value of satellite: 16.1 million$ Global Warming Monitor: Y Payload insurance Y Launch Insurance N (Insurance on 17 million) Service ORBLH 90,000,000 Orbit GTO Payload Value 16100000 Global Warming Monitor Y TAX (earth Sciences) 2,093,000 Payload insurance ILLOYDS 1,142,400 Launch Insurance 0 NESA Fees 120,000 Total 93,355,400 Service: ORBC2U Orbit: GTO Value of satellite: 170,000$ Payload insurance Y Launch Insurance Y (cube sat to GTO) Service ORBC2U 1,000,000 Orbit GTO 300,000 Payload Value 170000 Global Warming Monitor N TAX (earth Sciences) 0 Payload insurance PL200 10,000 Launch Insurance LI-2 9,100 NESA Fees 120,000 Total 1,439,100 Marking Rubric Marks Feature 0 No submission till too late (once I have gone through the answer in the lecture It can’t be marked any more) 1 You made an effort, but it does not really work 2 It has errors that should have been detected during testing 2.5 It’s just barely adequate – probably has a minor error or poor edit checking 3 It computes the correct amounts – it can be a little untidy and have 1 or 2 editing errors. 4 It’s close to perfect and only outputs to the console The insurance prompt includes the Insurance service code 5 It has two printout modes one onto the UCCanvas with a bit of graphics and the alternative to the console. (I will post an example to the forum) Deduct 0.5 marks if It does not loop Sample Run 1 Sample Run 2 (Example run with input error) Example pretty Quote (enter y to the Want Formatted Quote Y/N question) Finally an example run with tax calculation:

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.awt.*;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.*;

public class SpaceW {

    public static void main(String[] args) {

       /*JFrame mainFrame = new JFrame("Quote SpaceW");
       mainFrame.getContentPane().add(new MyCanvas());
       mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       mainFrame.pack();
       mainFrame.setVisible(true);*/
       Scanner keyboard = new Scanner(System.in);
       String[] serviceCodes = {
            "ORBL", "ORBLH", "ORBC1U", "ORBC2U", "ORBC3U", "ORBC6U", "EXIT"};

       String[] orbitSample = {
            "LEO", "GTO", "EXIT"
       };
       String[] yesNoSample = {
            "Y", "N", "EXIT"
       };

       /**
         * The system must also loop – to do more than one quote in a single
         * run, you don’t need an exit on every input – but you must have a way
         * to cleanly leave the system, with a message “** Program ending **” or
         * something similar.
         */
       while (true) {
            String serviceCode = getString(
                   "Please input service code or 'exit' to end:",
                   "\nInvalid service code please enter a valid one\n\n"
                   + " or enter 'exit' to exit:\n", serviceCodes, keyboard);
            if (serviceCode.equalsIgnoreCase("EXIT")) {
                break;
            }
            String orbit = getString(
                   "Please input the Orbit (LEO or GTO) or 'exit':",
                   "\nInvalid orbit code please enter a valid one\n\n"
                   + " or enter 'exit' to exit:\n", orbitSample, keyboard);
            if (orbit.equalsIgnoreCase("EXIT")) {
                break;
            }...

By purchasing this solution you'll be able to access the following files:
Solution.java.

$55.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats