(a)
Program Plan:
- IDNumber, Make, Year, Price, autoId, autoMake, autoYear, autoPriceand temp2 variables are used in the program.
- ToString (),TryParse (), Any (), Add (), Sum (), Sort (),CompareTo (),andJoin () methods are used in the program.
Program Description: The main purpose of the program is to prompt the user to enter the data for the eight Automobile class objects. Create an Automobile class with the auto-implemented properties for the instance variable named IDNumber, make, year, and price. Return all the data of the Automobile class using the ToString () method. Sort the objects of the Automobile class in the IDNumber order.
(b)
Program Plan:
- IDNumber, Make, Year, Price, autoId, auto Make, auto Year, auto Price, Financed Amount, Interest Rate, autoFinAm,and auto IR variables are used in the program.
- ToString (),TryParse (), Any (), Add (), Sum (), Sort (),CompareTo (),andJoin() methods are used in the program.
Program Description: The main purpose of the program is to drive a new class named Financed Automobile from the base class named AutoMobile. Incude two extra instance variable in the Financed Automobile class to store the financed amount and interest rate of an Automobile. Create the auto-implemented properties for the financed amount and interest rate variable. Override the ToString () method of the AutoMobile class in the Financed Automobile class to display the value of financed amount and interest rate of an Automobile. Prompt the user to enter the details off our Financed Automobile class objects. The financed amount must be less than the price of an Automobile. Return all the data of the Automobile class using the ToString () method. Sort the objects of the Automobile class in the ID Number order.Display the total of the price of all the Automobiles.Display the total of the financed amount of all the Automobiles.
(c)
Program Plan:
- IDNumber, Make, Year, Price, autoId, autoMake, autoYear, autoPrice, FinancedAmount, InterestRate, autoFinAm,andautoIRvariables are used in the program.
- ToString (),TryParse (), Any (), Add (), Sum (), Sort (),CompareTo (),Join (), andstring.Format()methods are used in the program.
Program Description:The main purpose of the program is to use an extension method for the class named FinancedAutomobile. This method is used to compute and return the monthly due payment of a FinancedAutomobile. Prompt the user to enter the details of four FinancedAutomobile class objects. Display all the data of all four objects.
Trending nowThis is a popular solution!
Chapter 10 Solutions
Microsoft Visual C#
- The operator used to create objects is = += new createarrow_forwardMicrosoft Visual C# 7th edition. In Chapter 7, you modified the GreenvilleRevenue program to include a number of methods. Now, using your code from Chapter 7 Case Study 1, modify your program so every data entry statement uses a TryParse() method to ensure that each piece of data is the correct type. Any invalid user entries should generate an appropriate message that contains the word Invalid, and the user should be required to reenter the data. Cengage requirement for the shaded part is attached and I don't understand it. I need help with the highlighted part (getContestantData() method) please. Thanks using System; using static System.Console; using System.Globalization; class GreenvilleRevenue { static void Main() { int numLastYear; int numThisYear; double revenue; int fee = 25; const int MAX_CONTESTANTS = 30; string[] names = new string[MAX_CONTESTANTS]; char[] talents = new char[MAX_CONTESTANTS]; char[] talentCodes = { 'S', 'D', 'M', 'O'…arrow_forwardRadio 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_forward
- Please 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_forwardStatic & Not Final Field: Accessed by every object, Changing Non-Static & Final Field: Accessed by object itself, Non-Changing Static & Final: Accessed by every object, Non-Changing Non-Static & Not Final Field: Accessed by object itself, ChangingRead the following situation and decide how the variables should be defined. You have a class named HeartsPlayerA round of Hearts starts with every player having 13 cardsPlayers then choose 3 cards to “trade” with a player (1st you pass left, 2nd you pass right, 3rd you pass across, 4th you keep)Players then strategically play cards in order to have the lowest scoreAt the end of the round, points are cumulatively totaled for each player.If one player’s total is greater than 100, the game ends and the player with the lowest score wins. 1. How should the following data fields be defined (with respect to final and static)?(a) playerPosition (These have values of North, South, East, or West)(b) directionOfPassing(c) totalScore…arrow_forwardMicrosoft Visual C# 7th edition. In Chapter 7, you modified the GreenvilleRevenue program to include a number of methods. Now, using your code from Chapter 7 Case Study 1, modify your program so every data entry statement uses a TryParse() method to ensure that each piece of data is the correct type. Any invalid user entries should generate an appropriate message that contains the word Invalid, and the user should be required to reenter the data. I am working in CENGAGE MINDTAP. Here is my code, but the TryParse is not working. I am not getting the point for TryParse. thanks using System; using static System.Console; using System.Globalization; class GreenvilleRevenue { static void Main() { int numLastYear; int numThisYear; double revenue; int fee = 25; const int MAX_CONTESTANTS = 30; string[] names = new string[MAX_CONTESTANTS]; char[] talents = new char[MAX_CONTESTANTS]; char[] talentCodes = { 'S', 'D', 'M', 'O' }; string[]…arrow_forward
- Design an application that tracks airline flights. The Flight Schedule is the most important part of the application, which is a collection of flights. Each flight has several attributes, including the Airline and the Aircraft information. The Airline is identified by a name, such as Delta Air, and a code for all of its flights, such as DL. For simplicity, you can assume that every airline has a fleet of one particular type of aircraft. This allows the user to enter only the airline code to fill the rest of the aircraft data when the flight data is entered into the system. Flight Schedule Design: Define the structure for the Flight Schedule. Identify data fields for Airline Name, Airline Code, Aircraft Name/Model, Seat Capacity, and Class-specific seat numbers. Identify data fields for each flight, including Airline Code, Flight number, Flight status, and Flight Type. Define Departure data fields: Day-of-the-week, Departure Time, Airport Code, Departure Gate. Define Arrival data…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_forwardCreate a class named Salesperson. Data fields for Salesperson include an integer ID number and a double annual sales amount. Methods include a constructor that requires values for both data fields, as well as get and set methods for each of the data fields. Write an application named DemoSalesperson that declares an array of 10 Salesperson objects. Set each ID number to 9999 and each sales value to zero. Display the 10 Salesperson objects.arrow_forward
- Create an application named SalesTransactiobDemo that declares several SalesTransaction objects and displays their values and their sum. Name - The salesperson name (as a string) sales Amount- The sales amount (as a double) commission- The commission (as a double) RATE- A readonly field that stores the commission rate (as a double). Define a getRate() avcessor method that returns the RATE Include 3 constructors for the class. One constructor accepts values for the name, sales amount, and rate, and when the sales value is set, the constructor computes the commission as sales value times commission rate. The second constructor accepts a name and sales amount, but sets the commission rate to 0 The third constructor accepts a name and sets all the other fields to 0arrow_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_forwardCreate two enumerations that hold colors and car modeltypes. You will use them as field types in a Car class and write ademonstration program that shows how the enumerations are used.arrow_forward
- 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