Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 8E
Program Plan Intro
Program plan: -
- Use the packages and define the namespaceConferenceApplication.
- Define the class ConferencesDemo, inside the class define the main method.
- Create an instance of 5 Conference objects.
- Use the loop to read the 5 Conference objects in the list.
- Call the Sort method to sort the list.
- Use the loop to print sorted conference by number of attendees.
- Define the namespace ConferenceApplication .
- Define the class Conference and implement the interface IComparable .
- Declare the variables as per the requirement.
- Define the parameterized constructor to initialize the variables.
- Use the property to implement the getters and setters.
- Override CompareTomethod .
- Create the object and compare the number of attendees in each group.
- Define the display() method to display the values.
Program description: -
The main purpose of the program named “ ConferenceDemo ” is to enter the data of five Conference objects and then display them in order of smallest to largest. The conference class consists of data members group name, starting date, and the number of attendees. Also, include theIComparable.CompareTo () method to sort the Conference objects.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
The xxx_Student class:– Name - the name consists of the First and Last name separated by a space.– Student Id – a whole number automatically assigned in the student class– Student id numbers start at 100. The numbers are assigned using a static variable in the Student class• Include all instance variables• Getters and setters for instance variables• A static variable used to assign the student id starting at 100• A toString method which returns a String containing the student name and id in the format below:Student: John Jones ID: 101
The xxx_Course classA Course has the following information (modify your Course class):– A name– An Array of Students which contains an entry for each Student enrolled in the course (allow for up to 10 students)– An integer variable which indicates the number of students currently enrolled in the course.
Write the constructor below which does the following:Course (String name)Sets courseName to nameCreates the students array of size 10Sets number of…
Appointment Class Requirements
The appointment object shall have a required unique appointment ID string that cannot be longer than 10 characters. The appointment ID shall not be null and shall not be updatable.
The appointment object shall have a required appointment Date field. The appointment Date field cannot be in the past. The appointment Date field shall not be null.Note: Use java.util.Date for the appointmentDate field and use before(new Date()) to check if the date is in the past.
The appointment object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null.
Appointment Service Requirements
The appointment service shall be able to add appointments with a unique appointment ID.
The appointment service shall be able to delete appointments per appointment ID.
Create the StockTask1 Java project
Create a Stock object class that contains the following information:
The symbol of the stock is stored in a private string data field called symbol.
The stock's name is stored in a private string data field called name.
previousClosingPrice is a private double data area that stores the stock price for the previous day.
currentPrice is a private double data area that stores the stock price at the current time.
A constructor for creating a stock with the given symbol and name.
For the data fields, there are accessor methods (get-methods).
For the data fields, there is a mutator method (set-methods).
A method named getChangePercent()that returns the percentage changed from previousClosingPrice to currentPrice.
Formula:perc_change = (current price - previous closing price) / previous closing price x 100
Create a test class named testStockthat creates a Stockobject with the stock symbol SUNW, the name Sun Microsystems Inc., and the previous closing…
Chapter 9 Solutions
Microsoft Visual C#
Ch. 9 - Assume that you have created a class named...Ch. 9 - Prob. 9RQCh. 9 - Assume that you have created a class named...Ch. 9 - Create an application named SalesTransactionDemo...Ch. 9 - Create an application named CarDemo that declares...Ch. 9 - Create a program named SalesTaxDemo that declares...Ch. 9 - Prob. 8ECh. 9 - Write a program named DemoJobs for Harolds Home...Ch. 9 - a. Write a FractionDemo program that instantiates...Ch. 9 - Prob. 1DE
Knowledge Booster
Similar questions
- The __str__ method of the Bank class (in bank.py) returns a string containing the accounts in random order. Design and implement a change that causes the accounts to be placed in the string in ascending order of name. Implement the __str__ method of the bank class so that it sorts the account values before printing them to the console. In order to sort the account values you will need to define the __eq__ and __lt__ methods in the SavingsAccount class (in savingsaccount.py). The __eq__ method should return True if the account names are equal during a comparison, False otherwise. The __lt__ method should return True if the name of one account is less than the name of another, False otherwise.arrow_forwardThe __str__ method of the Bank class (in bank.py) returns a string containing the accounts in random order. Design and implement a change that causes the accounts to be placed in the string in ascending order of name. Implement the __str__ method of the bank class so that it sorts the account values before printing them to the console. In order to sort the account values you will need to define the __eq__ and __lt__ methods in the SavingsAccount class (in savingsaccount.py). The __eq__ method should return True if the account names are equal during a comparison, False otherwise. The __lt__ method should return True if the name of one account is less than the name of another, False otherwise. The program should output in the following format: Test for createBank: Name: Jack PIN: 1001 Balance: 653.0 Name: Mark PIN: 1000 Balance: 377.0 ... ... ... Name: Name7 PIN: 1006 Balance: 100.0 bank.py """ File: bank.py Project 9.3 The str for Bank returns a string of accounts sorted by name.…arrow_forwardThis is the question I am stuck on - Radio station KJAVA wants a class to keep track of recordings it plays. Create a class named Recording that contains fields to hold methods for setting and getting a Recording’s title, artist, and playing time in seconds. Write an application that instantiates five Recording objects and prompts the user for values for the data fields. Then prompt the user to enter which field the Recordings should be sorted by—(S)ong title, (A)rtist, or playing (T)ime. Perform the requested sort procedure, and display the Recording objects. This is what I have so far - public class Recording { private String song; private String artist; private int playTime; public void setSong(String title) { this.song = title; } public void setArtist(String name) { this.artist = name; } public void setPlayTime(int time) { this.playTime = time; } public String getSong() { return song; } public String…arrow_forward
- Radio station KJAVA wants a class to keep track of recordings it plays. Create a class named Recording that contains fields to hold methods for setting and getting a Recording’s title, artist, and playing time in seconds. Write an application that instantiates five Recording objects and prompts the user for values for the data fields. Then prompt the user to enter which field the Recordings should be sorted by—(S)ong title, (A)rtist, or playing (T)ime. Perform the requested sort procedure, and display the Recording objects. Given classes: public class Recording { privateString song; privateString artist; privateint playTime; publicvoidsetSong(Stringtitle) { } publicvoidsetArtist(Stringname) { } publicvoidsetPlayTime(inttime) { } publicStringgetSong() { } publicStringgetArtist() { } publicintgetPlayTime() { } } import java.util.*; public class RecordingSort { publicstaticvoidmain(String[] args) { // Write your code here } publicstaticvoidsortByArtist(Recording[] array) { //…arrow_forwardcreate a program called automobile loan this program stores a loan number, make and model of automobiles, and the loan balance. include the methods to set values for each data field and a methods that display all the loan information create two automobileloan objects and sets and display their values. create another two automobileloan objects and ask the user for the values, then display those values. you should have four objects in total created.arrow_forwardIn C#, Create a program named ConferencesDemo for a hotel that hosts business conferences. Allows a user to enter data about five Conference objects and then displays them in order of attendance from smallest to largest. The Conference class contains fields for the following: group - The group name (as a string) date - The starting date (as a string) attendees - The number of attendees (as an int) Include properties for each field. Also, include an IComparable.CompareTo() method so that Conference objects can be sorted in order from least to greatest attendees.arrow_forward
- Design an application that declares an array of 20 AutomobileLoan objects. Prompt the user for data for each object, and then display all the values.arrow_forwardPlease written by computer source What will the application do? Display a set of at least 6 cars (at least 3 new and 3 used) along with Add and Quit options Let the user select one of the cars. Ask if they want to buy the car. If they enter yes, remove it from the list. If they want to add another car to the list, get the details, create a new instance of the appropriate class (Car class for new cars, or UsedCar), and add it to your data collection. Keep looping until they choose to quit. Build Specifications If your instructors tells you to work in pairs, stay with your assigned pair for this lab. Create a class named Car to store the data about a car. This class should contain:Data members for car details A string for the make A string for the model An int for the year A decimal for the price A no-arguments constructor that sets data members to default values (blanks or your choice) A constructor with four arguments matching the order above Properties for all data members An…arrow_forwardCreate a class name Taxpayer. Data fields for Taxpayer include yearly gross income and Social Security number (use an int for the type, and do not use dashes within the Social Security number). Methods include a constructor that requires a value for both data fields and two methods that each return one of the data field values. Write an application named USeTaxpayer that declares an array of 10 Taxpayer objects. Set each Social Security number to 999999999 and each gross income to zero. Display the 10 Taxpayer objects. Save the files as TAxpayer.java and USeTAxpayer.javaarrow_forward
- When we use the Group-Object cmdlet, it will create this new property, which displays the number of objects in each grouping: Group of answer choices Number Count Entry Namearrow_forward1: Create a enum PizzaType, which has the following entries: PIZZA_TYPE_PLAIN, PIZZA_TYPE_PEPPERONI, PIZZA_TYPE_SAUSAGE, PIZZA_TYPE_VEGGIE 2: Create a class PizzaSalesBarChart, which inherits from StoreSalesBarChart. Create a addPizzaSales(enum PizzaType) method. Return different value for different types of pizza. Create it own version of StoreSalesBarChart setDailySales(String salesName). This method should create a PizzaSalesBarChart instance, generate a random pizza type value 10 times and call addPizzaSales for each pizza type value, then return the PizzaSalesBarChart instance. In JoePizzaShop's main method, instead of calling "StoreSalesBarChart.setDailySales(salesName)", call " PizzaSalesBarChart .setDailySales(salesName)" and see what happens.arrow_forwardIn Java languagearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage