Question

**WRITE IN C# INTERMEDIATE LEVEL CODE A 2ND SEMESTER STUDENT COULD UNDERSTAND WELL** Problem Statement: Write...

**WRITE IN C# INTERMEDIATE LEVEL CODE A 2ND SEMESTER STUDENT COULD UNDERSTAND WELL**

Problem Statement:

Write an abstract class called Vacation includes a budget and a destination. It has an abstract method returning by how much the vacation is over or under budget. This class has two non-abstract subclasses:

All-Inclusive Vacation

brand (such as ClubMed, Delta Vacations, etc)

a rating (you can use # of stars)

price

Piecemeal Vacation

set of items (hotel, meal, airfare, etc)

set of corresponding costs (hotel cost, meal cost, airfare cost, etc.)

You need to write a test class to test all these classes and methods in each. You will need to start by writing the pseudocode for your programs, then code the solution and test your solution.

Break the problem down and write the pseudocode:

Break the problem statement into parts to fully understand what is expected as input, output and processes in your code. Write down all the variables you will need from the problem statement. Once you have broken down the problem, start writing your pseudocode.

Writing the pseudocode may take a while and several iterations to fully get the solution complete. Walk through the problem and your pseudocode as if the program is running and you are the user. Make sure your input prompts and output messages are clear.

Now make sure that your code is the best it can be. Check your formatting, prompts to the user, and make sure they are clear and help the user interact with your code in an easy manner.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Programe

public abstract class Vacation
{
    private double budget;
    private String destination;
  
    public Vacation( )
    {
        destination = "unknown";
    }
  
    public Vacation( String startDestination,
                     double startBudget )
    {
        destination = startDestination;
      
        if ( startBudget >= 0.00 )
            budget = startBudget;
        else
        {
            System.err.println( "Budget is negative." );
            System.err.println( "Value is set to 0.00" );
        }
    }
  
    public double getBudget( )
    {
        return budget;
    }
  
    public void setBudget( double newBudget )
    {
        budget = newBudget;
    }
  
    public String getDestination( )
    {
        return destination;
    }
  
    public void setDestination( String newDestination )
    {
        destination = newDestination;
    }
  
    public abstract double overOrUnderBudget( double budget, double price );
  
}

Add a comment
Know the answer?
Add Answer to:
**WRITE IN C# INTERMEDIATE LEVEL CODE A 2ND SEMESTER STUDENT COULD UNDERSTAND WELL** Problem Statement: Write...
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
  • Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a...

    Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a high level language of your choice and in Assembly to find a Fibonacci number and check your result. At the end of this assignment a possible solution to this problem is given both in Python and MIPS assembler. Note that it would have been possible to write the Python differently to achieve the same function. . [20 points] Write and debug a MIPS program...

  • I need to write a function in C# that would validated user entry for Payment Code...

    I need to write a function in C# that would validated user entry for Payment Code in the form. The form is used to collect information about payments. User can enter ad many rows/entries as he/she wishes by clicking "Add another Payment" button on the buttom. There is a Payment Code field that needs to be validates. It's a drop down list, with many values but the user is eligible to select only two of them: Meal and Travel. Every...

  • Create the Python code for a program adhering to the following specifications. Write an Employee class...

    Create the Python code for a program adhering to the following specifications. Write an Employee class that keeps data attributes for the following pieces of information: - Employee Name (a string) - Employee Number (a string) Make sure to create all the accessor, mutator, and __str__ methods for the object. Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: - Shift number (an integer,...

  • ********C++******** Develop the code to solve the problem statement below. Follow these style guidelines as you...

    ********C++******** Develop the code to solve the problem statement below. Follow these style guidelines as you develop the code. Use commenting to describe your code, and practice debugging if you run into errors. Submit your final source code. Problem Statement: Open the rule document for the game you selected for your final project: LCR Rules Farkle Rules Liar's Dice Rules Use the document to write rules for the user on how to play the game in a text file. Then,...

  • CAN SOMEONE HELP WITH THIS? Part 1: power() method We want to write a method that...

    CAN SOMEONE HELP WITH THIS? Part 1: power() method We want to write a method that will enable us to calculate a number to a given power. In other words, we are writing a method to mimic what the Math.pow() method we have seen before does. To write this method use the following requirements: The method should return an integer. It should have two parameters x and y both integers. The name of this method will be power(). For the...

  • what would be the solution code to this problem in c++? The Problem Write program that...

    what would be the solution code to this problem in c++? The Problem Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 Hint: Use vectors and vector functions to store the set of items 2. Get the number of...

  • this assingent is to  pseudocode, i have instructions and the example my teacher had given me for...

    this assingent is to  pseudocode, i have instructions and the example my teacher had given me for this, could i have some assistance, i need to do this in netbeans IDE and i need to use the scanner method as well and i need to pass both. Overview: This assignment will allow you to use pseudocode to implement the program to see the value in planning first, coding later. While coding is the glamorous part of the job, software development is...

  • C++ code please asap QUESTIONS Write the test main function as described next. This function is...

    C++ code please asap QUESTIONS Write the test main function as described next. This function is NOT a member function of either of the two classes above. It is located in separate source file. Create an array of type Flight and size 10 1. Prompt the user to enter values for speed, name, and id for all 10 objects. You must use the overloaded input stream operator of class Flight. 1. Write the value of the name variable of all...

  • I tried to complete a Java application that must include at a minimum: Three classes minimum...

    I tried to complete a Java application that must include at a minimum: Three classes minimum At least one class must use inheritance At least one class must be abstract JavaFX front end – as you will see, JavaFX will allow you to create a GUI user interface. The User Interface must respond to events. If your application requires a data backend, you can choose to use a database or to use text files. Error handling - The application should...

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
ADVERTISEMENT