Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program # 1 CS 2 6 0 Data Structures Please follow submission instructions in style sheet. GENERAL INFORMATION about PROGRAMS in CS 2 6 0
Program #
CS Data Structures
Please follow submission instructions in style sheet.
GENERAL INFORMATION about PROGRAMS in CS:
Scope: For each project, we only have approximately weeks to complete the writeups and code. Therefore, it is critical that you focus on a limited scope, with an emphasis on the classes and data structures, rather than building a comprehensive application. Each program this term will have you create an Abstract Data Type ADT which is what you will be primarily graded on This means that we will primarily grade your projects based on the use of classes, member functions, arguments, data structures, pointers, efficiency, and how well the software demonstrates that it has been fully tested. The code needs to compile and run, and include a test program for the member functions provided. It is not appropriate to hard code in the test cases all tests should be interactive with the user. Your user interface must be clear for us to thoroughly test all features.
Class construct: Most programming assignments this term requires only two classes, the data class and the data structure class. You can make the user interface a class as well if you choose to
Design is the First Step: The first step will be to design your software. This should include designing classes that are well structured and that efficiently use the data structure. The use of recursion should be included at least once in each assignment to better prepare us for future programs. Avoid multiple traversals whenever possible. Take a look at the style sheet for instruction on the topics that your writeups need to cover.
Creating Test Plans: Part of the first step will be to develop a test plan. This includes planning out each of the cases that need to be implemented and subsequently tested. It is important to focus on thoroughly testing your class member functions.
BACKGROUND INFORMATION for Program #:
This first program is an exercise in building, traversing, and destroying linear linked lists.
Programming Assignment: For the first programming assignment, we are going to create a program that helps keeping track of song lists.
Your primary job will be to create an ADT for Song and an ADT for SongList
Part I: The Song ADT
The information about a song should include:
Artist name eg Eminem
Title eg Lose Yourself
Length eg
Number of likes eg
Part II: The SongList ADT
The data members for SongList should be a head pointer to a linear linked list of Song objects and the number of songs in the list. The songs should be organized by popularities with the most popular song as the first node in the list.
This ADT must have public member functions to perform the following:
Constructor Construct an object and initialize the data members
Destructor Release all dynamic memory and reset data members to their zero equivalent value
Add a new song
Edit the number of likes for a song
Display all songs in the list
Display all songs for an artist in order of popularity
Remove all songs with fewer than M likes, where M is sent in as an argument
Part III: The driver or the test program
The test program needs to first load the test data set from external file at the beginning of the program.
The menubased user interface should allow user to usetest ALL the functionalities of the program. Try to make the user interface easier to use.
Always prompt user when you need input data.
The prompt needs to be meaningful. Example works great. EgEnter the minimum likes eg :
When asking user to choose some existing data, index works great. You can display the data with index preceding each one first.
Things you should know...as part of your program:
General Syntax Rules
Do not use statically allocated arrays in your classes or structures. All memory must be dynamically allocated and kept to a minimum for the classes! You can only use statically allocated arrays for temporary storage, such as local variables.
Global variables are not allowed in CS; global constants are encouraged
Do not use the String class! use cstring, arrays of characters instead; you may use the cstring library with strlen, strcpy strcmp etc
Avoid using return from within the body of a loop
Avoid using while type of syntax
Strive towards structured programming techniques
Remember that at least one function needs to be written using recursion!
For functions that have nonvoid return types, make sure to return a value through each path through the function.
NEVER pass class types by value always by reference; NEVER return class types by value. If you dont want the objects modified, put const there.
Use the iostream library for all IO; do not use stdio.h for IO
Use of external data files is required
MOST IMPORTANT:
BACKUP your files before cre
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started