Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

/ * SAMPLE OUTPUT [ arathi@hills ~ ] $ . / a . out Please enter the name of the song: RingObjective For this week's

/* SAMPLE OUTPUT
[arathi@hills ~]$ ./a.out
Please enter the name of the song: RingObjective
For this week's assignment, your goal is to be familiar with UML and also to get
accustomed to our CCSF computer systems and homework submission process. The
required C++ is straightforward.
Instructions
Consider the following UML diagram for a class containing information about a song:
name: string
artist: string
sethame (n : string) : void
setartista : sting) : void
+gstan-=0 : sting
getarisio : sting
This simple class has two member variables and four member functions to set and get
the variables.
setName should change member variable name to the parameter n
setArtist should change member variable artist to the parameter a
getName should return member variable name
getArtist should return member variable artist
Implement a complete C++ program which declares this class and implements all four of
its member functions. Then, create a simple main() program which creates an object of
the class, asks the user for name and artist, calls the set functions to assign reasonable
values for name and artist, and then calls the get functions to output both name and
artist to the console. You should do this all in one .cpp file.
Hint: to input strings that may contain spaces, use getline instead of cin.
Submission
See "Using hills to write, compile, run, and submit C++ programs" in the
page in this module. This provides a video and step-by-step instructions
on how to write your program, compile it, run it, and submit your program and sample
output using nano and g++ on hills. Copy and paste your sample output at the bottom of
your program file in a multi-line comment, it should look something like this. I have
bolded the user input I typed in while running the program: of Fire
Please enter the name of the artist: Johnny Cash
The name of the song is Ring of Fire
The name of the artist is Johnny Cash
[arathi@hills ~]$
*/
Submit your C++ source code and sample output all in one file via Canvas. The file format must be plain text, with a .cpp extension.. It must not be a rich format like .rtf,.doc, .pdf, etc.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions