Chat with us, powered by LiveChat Computer science 2 assignments | WriteMoh

Computer science 2 assignments

Question Description

CptS 122 – Data Structures

Programming Assignment 2: Digital Music Manager & Doubly Linked Lists – Part I

Due: Friday, February 1, 2018 by midnight

I. Learner Objectives:

At the conclusion of this programming assignment, participants should be able to:

Design and implement a dynamic doubly linked list

Allocate and de-allocate memory at runtime

Manipulate links in a dynamic list

Insert items into a dynamic linked list

Delete items from a dynamic linked list

Edit items in a dynamic linked list

Traverse a dynamic linked list

II. Prerequisites:

Before starting this programming assignment, participants should be able to:

Analyze a basic set of requirements for a problem

Compose C language programs

Compile a program using Microsoft Visual Studio 2015 or 2017

Create basic test cases for a program

Apply arrays, strings, and pointers

Summarize differences between array notation and pointer notation

Apply pointer arithmetic

Apply basic string handling library functions

Define and implement structures in C

Summarize the operations of a linked list

III. Overview & Requirements:

Many of us have large digital music collections that are not always very well organized. It would be nice to have a program that would manipulate our music collection based on attributes such as artist, album title, song title, genre, song length, number times played, and rating. For this assignment you will write a basic digital music manager (DMM).

Your DMM program must have a text-based interface which allows the user to select from a main menu of options including: (1) load, (2) store, (3) display, (4) insert, (5) delete, (6) edit, (7) sort, (8) rate, (9) play, (10) shuffle, and (11) exit. For Part I of the assignment, you will only need to complete the main menu, (1) load, (2) store, (3) display, (6) edit, (8) rate, (9) play, and (11) exit features. The other features will be completed in the next part of the assignment.

ØWhat must the main menu contain?

The main menu must display the following commands:

(1) load

(2) store

(3) display

(4) insert

(5) delete

(6) edit

(7) sort

(8) rate

(9) play

(10) shuffle

(11) exit

After a command is selected and completed, your program must display the main menu again. This procedure will continue until the “exit” command is selected.

ØWhat must “load” do?

The “load” command must read all records from a file called musicPlayList.csv (you may find a sample file here) into a dynamic doubly linked list. The doubly linked list is considered the main playlist. As each record is read from the file, it must be inserted at the front of the list. Each record consists of the following attributes:

Artist – a string

Album title – a string

Song title – a string

Genre – a string

Song length – a struct Duration type consisting of seconds and minutes, both integers

Number times played – an integer

Rating – an integer (1 – 5)

Each attribute, in a single record, will be separated by a comma in the .csv (comma separated values) file. This means that you will need to design an algorithm to extract the required attributes for each record. Each field in each record will have a value. You do not need to check for null or empty values.

You must define a struct called Record to represent the above attributes. Also, do not forget that the Song Length must be represented by another struct called Duration. Durationis defined as follows:

Minutes – an integer

Seconds – an integer

Finally, each struct Node in the doubly linked list must be defined as follows:

Data – a Record

Pointer to the next node

Pointer to the previous node

ØWhat must “store” do?

The “store” command writes the current records, in the dynamic doubly linked list, to the musicPlayList.csv file. The store will completely overwrite the previous contents in the file.

ØWhat must “display” do?

The “display” command prints records to the screen. This command must support two methods, one of which is selected by the user:

1.Print all records.

2.Print all records that match an artist.

ØWhat must “edit” do?

The “edit” command must allow the user to find a record in the list by artist. If there are multiple records with the same artist, then your program must prompt the user which one to edit. The user may modify all of the attributes in the record.

ØWhat must “rate” do?

The “rate” command must allow the user to assign a value of 1 – 5 to a song; 1 is the lowest rating and 5 is the highest rating. The rating will replace the previous rating.

ØWhat must “play” do?

The “play” command must allow the user to select a song, and must start “playing” each song in order from the current song. “Playing” the song for this assignment means displaying the contents of the record that represents the song for a short period of time, clearing the screen and showing the next record in the list, etc. This continues until all songs have been played.

ØWhat must “exit” do?

The “exit” command saves the most recent list to the musicPlayList.csv file. This command will completely overwrite the previous contents in the file.

IV. Logical Block Diagram

The logical block diagram for your doubly linked list should look like the following:

As you can see from the illustration a doubly linked list has a pointer to the next node and the previous node in the list. The first node’s previous node pointer is always NULL and the last node’s next pointer is always NULL. When you insert and delete nodes from a doubly linked list, you must always carefully link the previous and next pointers.

V. Submitting Assignments:

  1. Using the OSBLE+ MS VS plugin, please submit your solution. Please visit https://github.com/WSU-HELPLAB/OSBLE/wiki/Submitting-an-Assignment for more information about submitting using OSBLE+.
  2. Your project must contain at least one header file (a .h file), two C source files (which must be .c files), and a local copy of the .csv file.
  3. Your project must build properly. The most points an assignment can receive if it does not build properly is 65 out of 100.

VI. Grading Guidelines:

This assignment is worth 100 points. Your assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria:

5 pts – Appropriate top-down design, style, and commenting according to class standards

4 pts – For correct definition of struct Record

2 pts – For correct definition of struct Duration

3 pts – For correct definition of struct Node

5 pts – For correctly displaying the main menu, getting the command from the user, and executing the command

3 pts – For looping back to main menu after a command is executed

21 pts – For correctly constructing a doubly linked list, including:

1.(6 pts) For correct implementation a makeNode() function, which allocates space for a struct Node on the heap, and initializes the node

2.(9 pts) For correct implementation of insertFront() function, which calls makeNode() and returns 1 for successfully allocating space for a node; 0 otherwise

3.(6 pts) For correct implementation of printList(), which visits each node in the list and prints out the contents of the record

15 pts – Correct “load” command implementation

1.(2 pts) For correctly opening musicPlayList.csv for mode “read”

2.(6 pts) For correctly extracting each attribute from each record in the file

3.(5 pts) For correctly using insertFront()

4.(2 pts) For correctly closing musicPlayList.csv

13 pts – Correct “store” command implementation, which writes the records in the list to the musicPlayList.csv file.

1.(3 pts) For opening musicPlayList.csv for mode “write”.

2.(10 pts) For correctly writing all the records in the list to the file, maintaining the .csv format

7 pts – For correct “display” command implementation

1.(2 pts) For displaying all records by using printList ()

2.(5 pts) For searching for specific records based on artist and displaying matching record – should be able to use the same search function as used in the “edit” command

7 pts – Correct “edit” command implementation

1.(2 pts) For searching for specific records based on artist – should be able to use the same search function as used in the “display” command

2.(5 pts) For editing the record specified by the user

3 pts – Correct “rate” command implementation

7 pts – Correct “play” command implementation

1.(2 pts) For playing all songs in order until the end of the list

2.(5 pts) For searching for specific song based on song title and playing all songs until the end of the list has been reached

5 pts – Correct “exit” command implementation, which writes the records in the list to the musicPlayList.csv file, and exits the program.

—————————————————————————————————————————————————————-

Programming Assignment 1: Analyzing Fitbit Data

Assigned: Friday, January 11, 2019

Due: Friday, January 25, 2019 by midnight (extended due date)

I. Learner Objectives:

At the conclusion of this programming assignment, participants should be able to:

Analyze a basic set of requirements for a problem

Apply basic techniques for data cleansing or data cleaning

Analyze a medium set of data and compute results

Filter a dataset

Implement deduping methods

Compose C language programs

Create and compile a program using Microsoft Visual Studio 2015

Execute a program in Microsoft Visual Studio 2015

Create basic test cases for a program

Apply arrays, strings, and pointers

Define and apply structs

Parse strings from files

Convert strings to numerical values

Summarize differences between array notation and pointer notation

Apply basic string handling library functions

II. Prerequisites:

Before starting this programming assignment, participants should be able to:

Access Microsoft Visual Studio 2015 Integrated Development Environment (IDE)

Design and develop a small or medium sized program in any language

Apply sequential, conditional, and iterative constructs

Design and implement user-defined functions

III. Overview & Requirements:

The intent of this assignment is to review concepts from your prior “CS 1” course and to challenge and enhance those concepts.

Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that measure number of steps and distance walked, heart rate, sleep quality, floors climbed, and calories burned. In this assignment, you will analyze data that was generated from a Fitbit devices. The data is stored in a comma-separated values (.csv) file that you will find at: http://eecs.wsu.edu/~aofallon/cpts122/progassignments/FitbitData.csv. The entries in this file were merged from two different devices. You will need to filter any data that is not related to the target patient. The first data entry in the file contains the target. You will also need to dedupe any entries that appear multiple times and perform data cleansing any entries that have missing fields. A .csv file stores data as plaintext in tabular form. Each row in the file is considered a record. Each record consists of fields separated by commas.

In particular, you will analyze 24 hours of data. Each record in the “FitbitData.csv” represents one minute of data and consists of eight fields. These include the following:

1.Patient ID

2.Minute

3.Calories

4.Distance (in miles)

5.Floors

6.Heartrate

7.Steps

8.Sleep level

What data structures are required?

In this assignment, you must define a C struct to store a subset of the Fitbit data fields as follows:

typedef struct fitbit

{

char patient[10];

char minute[9];

double calories;

double distance;

unsigned int floors;

unsigned int heartRate;

unsigned int steps;

Sleep sleepLevel;

} FitbitData;

The type Sleep is enumerated and must be defined as follows:

typedef enum sleep

{

NONE = 0, ASLEEP = 1, AWAKE = 2, REALLYAWAKE = 3

} Sleep;

You must also define an array of FitbitData that can store 24 hours of minute data. Hence, you must declare an array of size 1440. You have the freedom to decide on other data structures and variables that you need for the assignment.

What are the other requirements?

This program does not require any user input! However, you will need to display some results to the screen!

-You must open “FitbitData.csv” for mode read; check for success

-You must read each record in the file as a string, one line at a time; if the record does not belong to the targetpatient, then it should be discarded

-You must parse each record into the corresponding fields, and store into the FitbitData array; note: not all fields have values, some are “empty” or null; if some of the fields are “empty” or null, then you must perform data cleansing and insert values to construct a record that is consistent with the others; the data inserted should not represent valid values

-You must compute the total calories burned, distance walked in miles, floors walked, and steps taken

-You must compute average heartrate over the 24 hour period

-You must report the max steps taken in one minute over the 24 hour period; if there are multiple minutes throughout the day where the max is discovered, then report the one that is the latest in the 24 hour period

-You must report the longest consecutive range of poor sleep; a range is defined as one or more consecutive minutes where the sleepLevel > 1; the poorest sleep is not based on the length of the range, but the sum of the sleep levels in the range; the max sum of the ranges is considered the poorest sleep (report the starting and ending minutes of range)

-You must open “Results.csv” for mode write; this will either create a new .csv or overwrite an existing one

-You must output two lines to “Results.csv” and to the screen in the following format:

oLine 1: Total Calories,Total Distance,Total Floors,Total Steps,Avg Heartrate,Max Steps,Sleep

oLine 2: valueCalories,valueDistance,valueFloors,valueSteps,valueHeartrate,valueMax,valueSleepStart:valueSleepEnd

oLines 3 – N: the filtered, deduped, and cleansed data in the original FitbitData.csv format

-You must close “FitbitData.csv” and “Results.csv”

IV. Submitting Assignments:

  1. Using the OSBLE+ MS VS plugin, please submit your solution. for more information about submitting using OSBLE+.
  2. Your project must contain at least one header file (a .h file), two C source files (which must be .c files), and a local copy of the .csv file.
  3. Your projects must build properly. The most points an assignment can receive if it does not build properly is 65 out of 100.

V. Grading Guidelines:

This assignment is worth 100 points. Your assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria:

5 pts for correctly defining struct FitbitData

3 pts for correctly defining enum Sleep

3 pts for correctly opening “FitbitData.csv” for mode read

2 pts for correctly checking the success of the file opening operation

10 pts for correctly reading each record in the file as a string, one line at a time, and filtering and deduping any lines that do not belong to the target patient or are duplicates

15 pts for correctly cleaning the data and parsing each record into the corresponding fields

5 pts for correctly converting the strings to the field types

5 pts for correctly storing the fields into the FitbitData array

3 pts for correctly computing the total calories burned

3 pts for correctly computing the total distance walked in miles

3 pts for correctly computing the total floors walked

3 pts for correctly computing the total steps taken

4 pts for correctly computing the average heartrate over the 24 hour period

8 pts for correctly determining the max steps taken in one minute over the 24 hour period

8 pts for correctly determining the longest consecutive range of poor sleep

3 pts for correctly opening “Results.csv” for mode write

8 pts for correctly formatting and outputting the data, without any duplicate entries, to “Results.csv” and to the screen

2 pts for correctly closing the “FitbitData.csv”

2 pts for correctly closing the “Results.csv”

5 pts for appropriate top-down design of functions and good style

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Do you need an answer to this or any other questions?

Have an assignment?

We are here to help you

Why we are the best

  •  High quality services
  •  On time delivery
  •  Professional writers
  •  Plagiarism free essays
  •  24/7 Customer Support
  • Satisfaction guarantee

Secure Payments