QuestionQuestion

Transcribed TextTranscribed Text

1. a. Define a class which represents a high school student. The structure shall have the following fields. A string which representing the student’s name, an integer representing the students ID #, a integer representing the number of credits the student has earned, and a float representing their grade point average. b. Declare an instance of the class. Initialize the data fields to the following data: Field Value Name Ferris Bueller ID 60654 Credits Earned 180 GPA 2.21 Page 2 of 4 2. a. Write a class which represents a tire and contains the following information: a string representing the brand name, an integer representing the width, an integer representing the diameter, and an integer representing the aspect ratio. b. Write a class which represents a car. The class shall contain the following information: an array of size four of the tire objects created in step A, and strings representing the car make and model, and an integer representing the year. c. Declare an instance of the car class created in step B. Initialize the data in the structure to be the following: Tire Set Field Tire Field Value tire[0] and tire[1] brand Cobra Radial G/T width 195 diameter 13 aspect ratio 70 tire[2] and tire[3] brand Enduro width 175 diameter 13 aspect ratio 70 Make N/A Fiat Model N/A 124 Spider Year N/A 1976 Page 3 of 4 3. (Upload as Source) The following program will be used to build a program which will implement a hypothetical iTunes player. The program will be built piece-wise over the course of several homework assignments. Therefore keep your files after this submission. Figure 1 Diagram of ITunes Program The above diagram represents the classes which will be used to create the final program. These classes include library, player, song, and user interface. The program will use file IO to populate the library full of songs, and a user interface will be used so that the user will be able to play a song using the player class. Hopefully by the time the project is done you will have a fully working music player. For the current assignment you will implement the Song class, and write some code which will eventually be used for the library. a. Write a Song class which contains the following fields: i. string representing the file location ii. string representing the song name iii. string representing the artist name iv. int representing the length of the song in seconds b. The file, songlist.txt, contains a list of songs and is provided. The format of the file is as follows: i. line 1: file location ii. line 2: Song Name iii. line 3: Artist Name iv. line 4: Song Length c. The above file format is then repeated for each song. d. In the main function do the following: i. Declare an array of Song objects of size 10. ii. Read in the contents of the file and store each song’s information as an object in the array created in the previous step. iii. Only part of the array will be used. Therefore while reading from the file track how many songs were read in using a counting variable. User Interface Library Song Player Page 4 of 4 iv. After the reading is complete, print the information of each song excluding the file location to the console in a tabular form as shown below.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

1.

#pragma once
#include <string>
using namespace std;

class student
{
public:
student(void)
{
}
student(string name, int id, int credits, double avg)
{
this->name = name;
this->ID = id;
this->credits = credits;
this->GPA = avg;
}
virtual ~student(void)
{
}...
$50.00 for this solution

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

Find A Tutor

View available Visual Basic Programming 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