Programming

Programming questions? Ask a programmer for answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

An ITunes entry in music library is a descriptor that

Customer Question
summarizes information about the tune...
An ITunes entry in music library is a descriptor that summarizes information about the tune that it describes. (It is not the actual tune, which is contained in a large music data file.) For each ITunes entry in your own music library file (which is in XML format, but we won't go there) there are between 20 and 50 fields -- i.e., members. If you were to look at the file on your system, you would find that the fields have names like Genre, Track ID, Name, Artist, Bit Rate, Sample Rate, Track Type, and so on.
We will consider a simplified ITunes class, that stores these ITunes entry objects, with only the following four members for each object:
•Name (the title of the song)
•Artist (the performing musician or group)
•Bit Rate (the number of kilobits per second that the ITunes object streams at or plays at -- higher for better quality, lower for smaller data file size)
•Total Time (the playing time of the ITunes object, represented in milliseconds, i.e., 36500 would stand for 36.5 seconds).
The assignment is to first create a class called ITunes that represents these four items, and provides solid protection for the fields. Then, the client, main(), will instantiate between four or more ITunes objects (some using default constructors and some using parameter-taking constructors), display them immediately, mutate many of their fields, display them again to reflect the changes, and finally reset each object to default values and display them one last time. Also, it should do some explicit accessor and mutator tests. This is described in detail further down.
The Program Spec
Class ITunes Spec
Private class instance members:
•string name - the title of the song. All legal strings should be between 1 and 80 characters.
•string artist - the performing musician or group. All legal strings should be between 1 and 80 characters.
•int bitrate - the number of kilobits per second. A legal value should be between 64 and 705.
•int totalTime - the playing time in milliseconds. A legal value should be between 1 second and 1 hour (expressed in milliseconds)
As stated in the modules, we never want to see a literal in our methods. So the class should have static members to hold values for the limits described above, as well as default values for any field that is constructed using illegal arguments from the client. These are put in the public static section.
Public class static consts:
•MIN_BITRATE = 64
•MAX_BITRATE = 705
•MIN_STR_LENGTH = 1
•MAX_STR_LENGTH = 128
•MIN_PLAY_TIME = 5000
•MAX_PLAY_TIME = 1000*60*60
•DEFAULT_BITRATE = 64
•DEFAULT_PLAY_TIME = 1000
•DEFAULT_STRING = " (undefined) "
You should supply all of the following public instance methods:
•Constructors -- one that takes no parameters (sets values to default) and one that takes all four parameters.
•Accessors (get()s) and Mutators (set()s) for each instance member.
•string toString() - a method that returns a string which contains all the information of the ITunes object. This string can be in any format as long as it is understandable and clearly formatted. Two of the many possible formats for such a string for one ITunes object might be:
◦"Janiva Magness, You Were Never Mine, 276 seconds, 128k bits per second"
◦"Title: You Were Never Mine / Artist: Janiva Magness / Playing Time: 4 minutes 36 seconds / Bit Rate: 128k"
•void setDefaults() - a method that can be called either by the client or as a helper method by the constructors. This method will reset all private data to their default values.
•void display() - an output method that sends the string returned by the toString() to the screen. display() can, alternatively, send the data directly to the screen on several lines in a different manner than toString(). It can also call upon toString() but prepend and append extra formatting for the console.
The Foothill main()
main() should instantiate four or more ITunes objects, some of them using the default constructor, some using the constructor that takes parameters. It should immediately display all object. Next, it should mutate one or more members of every object, after which it should display all objects a second time. Then, it should reset all objects to their default values using the appropriate method and display all objects one last time. It does not have to take any input from the user.
Other Testing
After the main section, confirm that your mutators correctly filter out and report bad arguments to the client by placing a couple mutator calls (not all of them) in if statements which print different messages depending on whether the mutator succeeded or failed. Also, demonstrate at least two different accessor calls to show that they work from main().
Submitted: 2 years ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Answered in 21 minutes by:
2/26/2016
Programmer: Ingo U, Software Engineer replied 2 years ago
Ingo U
Ingo U, Software Engineer
Category: Programming
Satisfied Customers: 796
Experience: Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
Verified

Hello,

I see this is in C++? What development tools/platform do you use?
If available, could you please post, attach or upload all relevant requirements, details, work in progress or any other related file(s)?

And, when is this due?
Thanks,

Ingo U

Ask Your Own Programming Question
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a programmerLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7,677
7,677 Satisfied Customers
Experience: MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

ATLPROG is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,175 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

848 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
I have a store in asp.Net, and I have a JQuery script that
Hi. I have a store in asp.Net, and I have a JQuery script that retrieves the order total. I need to pass that variable to a javascript in order to integrate to a payment gateway. I tried using the doc… read more
George Sibiya
George Sibiya
PhD
301 satisfied customers
I have a server and client assignment based off the last
Hey i have a server and client assignment based off the last assignment i am stucked with processing datacommented lines in gameplayframe is data needed to sent to server when client calls the frameco… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Assignment is due in 20 hours it is already partially
hey my assignment is due in 20 hours it is already partially completed but i am stucked like really stucked to make the last part work its about converting my console based game in my previous assignm… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
1. Create a C++ visual studio console application with the
1. Create a C++ visual studio console application with the name Project2. (As usual, to make the grader happy, it is critical that your project as well as your zip file contain your name and the exerc… read more
Ingo U
Ingo U
Software Engineer
796 satisfied customers
Need to create a console based application using C# .net. I
Hi, Need to create a console based application using C# *****I have a csv file that contain around 2 million post code. Need to write a bulk import code to validate the data in the csv file. The postc… read more
Bruce Wilner
Bruce Wilner
Master of Engineering
29 satisfied customers
Create an application named ShapesDemo that creates several
create an application named ShapesDemo that creates several objects that descent from abstract class called GeometricFigure. Each GeometricFigure include a height, width and an area. provide get and s… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Write a Java program that will serve as a basic calculator.
Write a Java program that will serve as a basic calculator. It should prompt the user for as many as four values. These values will then be either added, subtracted, or multiplied, depending on the us… read more
jayen
jayen
Bachelor's Degree
378 satisfied customers
Savings System, Using Spring framework and JDBC/bernate
Savings System, Using Spring framework and JDBC/Hibernate create a console-based application that has the following features- a. Employee login before any other functionality is available. (Employee a… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
I have a lab which is to write webServer in C in linux
i have a lab which is to write webServer in C in linux ubuntu, i done most of the code, but yet i can reach the server when i enter localhost:2000 in my browser, i think there is problem with the code… read more
George Sibiya
George Sibiya
PhD
301 satisfied customers
The following flowchart calculates a state's income tax.
The following flowchart calculates a state's income tax. Write a java program corresponding to the flowchart. Use console I/O. Make a loop allowing users to enter multiple tax calculations. Accumulate… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
PLEASE ANSWER ALL THE QUESTIONS IN CHAPTERS 5, 6, AND
PLEASE ANSWER ALL THE QUESTIONS IN CHAPTERS 5, 6, AND 7.Chapter 5 Best Answers: Choose the letter that corresponds to the best answer. More than one answer choice may achieve the goal. Select the BEST… read more
Chris Baxter
Chris Baxter
28 satisfied customers
Write a simple card-­‐shuffling simulator that might be used
Write a simple card-­‐shuffling simulator that might be used in a game of video poker. The program must represent two separate decks of 52 cards. The decks will be shuffled independently and then prin… read more
Raj
Raj
SAP ABAP Consultant
Master\u0027s Degree
27 satisfied customers
C++ assignment help, please! Design a Tips class that
For LogicPro only:C++ assignment help, please! Design a Tips class that calculates the gratuity on a restaurant meal. Its only class member variable, taxRate, should be set by a one-parameter construc… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
I need a solution for a program in c#? Basic sales tax is
Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax applicable on all imported goods at a rate of 5%, with no exemptions. When I purchase items I receive a receipt which lists the name of all the items and their price (including tax), finishing with the total cost of the items, and the total amounts of sales taxes paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount of sales tax. Write an application that prints out the receipt details for these shopping baskets. Input Shopping Basket 1: 1 book at 12.49 1 music CD at 14.99 1 chocolate bar at 0.85 Shopping Basket 2: 1 imported box of chocolates at 10.00 1 imported bottle of perfume at 47.50 Shopping Basket 3: 1 imported bottle of perfume at 27.99 1 bottle of perfume at 18.99 1 packet of headache pills at 9.75 1 imported box of chocolates at 11.25 Output Output 1: 1 book: 12.49 1 music CD: 16.49 1 chocolate bar: 0.85 Sales Taxes: 1.50 Total: 29.83 Output 2: 1 imported box of chocolates: 10.50 1 imported bottle of perfume: 54.65 Sales Taxes: 7.65 Total: 65.15 Output 3: 1 imported bottle of perfume: 32.19 1 bottle of perfume: 20.89 1 packet of headache pills: 9.75 1 imported box of chocolates: 11.85 Sales Taxes: 6.70 Total: 74.68 … read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Exercise 3.9/102 How do you generate a random integer i such
Exercise 3.9/102 How do you generate a random integer i such that 0≤ i < 20? How do you generate a random integer i such that 10 ≤ i < 20? How do you generate a random integer i such that 10 ≤ i… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Assignment4_1.java as the file name and Assignment4_1 as the
Assignment4_1.java as the file name and Assignment4_1 as the class name - Write a console program with a static method printHello() (in addition to main() method which is also static) that prints out … read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Python, "-"-"-"-" \ \ / / \ \ / / \ \ "-"-"-"-" no
quot;-"-"-"-" \ \ / / \ \ / / \ \ "-"-"-"-" JA: What programs and versions are you using? Customer: Python JA: What is your ideal outcome? How can we solve this for you? Customer: "-"-"-"-" \ \ / / \ … read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
You will need to create a console-based application whose
You will need to create a console-based application whose Main() method accepts ten integer values from the user and stores them in an array. Next, create a method that determines and displays the sma… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,175 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x