CS 300 Project 1 SH Pseudocode and Evaluation
.docx
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
300
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
8
Uploaded by SargentSummerAntelope68
Shyanne Helo SNHU CS 300 June 17, 2023
Professor Susalla Project 1 Pseudocode-
Open file using fstream Generate void method loadCourses(string csvPath, data structure)
Call to open file if the file not found than return value will be -1
Else if file is found While its not the end of file Read every line If > than 2 values in 1 line, than it returns error
Else read the parameters If 3 or more parameters If 3 or more parameters are in 1 parameter elsewhere continue Else it returns an error Close file Hold course info: Generate struct course{}
Generate identifier: course Id, course name, prereq Vector:
Vector<course> loadCourses(string csvPath)
For (int I = 0; I < file.rowcount(); i++){
Generate data structure & + to collection of courses: Course course;
Course.courseId = file[i[][1];
Course.name = file[i][0];
While its not the end of file Course.prereq = file[i][8];
Courses.push_back(course);
Hashtable:
Generate hashtable Create Node struct Course course;
Unnamed int key Vector<Node>nodes Describe tableSize Unnamed int(int key)
Generate inset method void Hashtable::Insert(course course)
Generate key for given course, search node with key value If no data found for key
Set node to key position Else if node used
Set prev node key = UNIT_MAX, set key, set prev node to course & prev node next
Null indicator Else find next open node + new newNode to end void loadCourses(string csvPath, HashTable* hashTable)
loop to read rows of a CSV file
for (unnamed int i = 0; i < file.rowCount(); i++) {
generate a data structure & + to collection of courses
Course course;
course.courseId = file[i][1];
course.name = file[i][0];
while not end of line
course.prereq. = file[i][8];
hashTable->Insert(course);
Binary Trees: name binary search tree to hold all the courses and course information BinarySearchTree * BST;
BST = new BinarySearchTree;
Course course;
Generate + node method void BinarySearchTree::addNode(Node* node, Course course)
If root = null, + root
if node is > root, + to left
if no left node
this node becomes left
if node is < root, + right
if no right node
this node becomes right
void loadCourses(string csvPath, BinarySearchTree* bst)
loop to read rows of a CSV file
for (unnamed int i = 0; i < file.rowCount(); i++) {
Generate a data structure & + to collection of courses
Course course;
course.courseId = file[i][1];
course.name = file[i][0];
while not end of line
course.prereq. = file[i][8];
BST->Insert(course);
Print course info & prereqs : Vector : Generate method void printCourseInfo(Vector<Course> courses, String courseId)
Obtain input for courseId
While vector is not empty
if the input = courseId
output course.courseId << output course.name
while (prereq = true)
output course.prereq
Hashtable: Generate method void printCourseInfo(Hashtable<Course> courses, String courseId)
Obtain input for courseId
Set key = courseId
Set node to the node.at(key)
if current node = key
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Rectangle's Length and Width
Code in C language
// WARNING: Do not add, remove, or change anything before the line 19 of this file.// Doing so will nullify your score for the activity.
#include <stdio.h>#include "rectangle.h"
int get_length(Rectangle *rect);int get_width(Rectangle *rect);
int main() { int ur_x, ur_y, ll_x, ll_y; printf("UR's X: "); scanf("%d", &ur_x); printf("UR's Y: "); scanf("%d", &ur_y); printf("LL's X: "); scanf("%d", &ll_x); printf("LL's Y: "); scanf("%d", &ll_y); // TODO: Initialize the points here // Point ... // TODO: Initialize the rectangle here // Rectangle ... // TODO: Call the get_length here int len = ___; printf("\nLength: %d", len); // TODO: Call the get_width here int wid = ___; printf("\nWidth: %d", wid); return 0;}
// TODO implement get_lengthint get_length(Rectangle *rect) { return 0;}
// TODO implement get_widthint get_width(Rectangle *rect){ return 0;}
refer to pics for instructions
arrow_forward
Debug this
arrow_forward
Programming language is C#
arrow_forward
C++ Language
arrow_forward
Can you please help me do this program, its for a class called Object Oriented Programming
arrow_forward
C++ Programming.
Associative and unordered associative containers.
Associative containers (set, map, multiset, multimap).
• When executing a given task, the input values must be read from a text file.
Task : Create a program that deletes a set of elements from a single word of a given string type and creates a second set of elements that consist of a single word, and also displays it on the screen.
arrow_forward
instruction: C++ language
arrow_forward
COMPUTER SCIENCE 130 JAVA PROGRAM
Chapter 4. Homework Assignment (read instructions carefully)
Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits):
Total: nnnnn.nnn
Average: nnnnn.nnn
Class name: FileTotalAndAverage
double_input1.txt double_input2.txt
PLEASE FIX AND MODIFY THIS JAVA SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASES. RIGHT NOW IT SAYS 0 OUT 3 PASSED. THE PICTURES THAT I PROVIDED PROOF THAT WHEN I UPLOAD IT TO HYPERGRADES IT FAILS TEST CASSES. THANK YOU.
import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.InputMismatchException;import java.util.Locale;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String…
arrow_forward
createDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles.
2. Reads the profiles from the input file.
3. For each person in the file
1. creates a Profile object with the information from file (see input file format below).
2. insert the newly created profile into the next position in the database array (instance variable).
arrow_forward
JAVA PPROGRAM
Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found.
While entering the file name, the program should allow the user to type quit to exit the program.
If the file with a given name does not exist, then display a message and allow the user to re-enter the file name.
The file may contain up to 100 names.
You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList.
Input validation:
a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…
arrow_forward
Assignment Submission Instructions:This is an individual assignment – no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows:/* ******************************************************************************** * Name: YourNameGoesHere * * Class: CST 235 * * Section: * * Date: * * I have not received or given help on this assignment: YourName * ***********************************************************************************/USE RetailDB;####### Tasks: Write SQL Queries ######### -- Task 1 (Customer Information):-- List your SELECT statement below.
Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQL
arrow_forward
In python please! I am struggling
arrow_forward
String data type is not allowed you can make use of CString instead (char arrays with null termination).
Q1. Create an Input File with the following information regarding to inventory:
Item_Id Price Quantity Availability
Add atleast 10 records in input file.
Where item_id will be of type int , price will be of type double , quantity will be of type int and Availability will be of type char representing the status y for yes the product is available and n for not available.
Write a menu driven C++ program to perform the following four tasks in a single file, if user press option 1 the task 1 get solved and so on:
1. Display the Item_Id of the products which are not available in stock on screen.
2. Copy all the available products data in a separate file.
3. Read the original input file and update the price of each item by 10 percent increase in the original price and save the complete information in separate file.
4. Try to save the information processed in part 3 in the original…
arrow_forward
JAVA PROGRAM
Chapter 4. Homework Assignment (read instructions carefully)
Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits):
Total: nnnnn.nnn
Average: nnnnn.nnn
Class name: FileTotalAndAverage
double_input1.txt double_input2.txt
Test Case 1
Please enter the file name: \ndouble_input1.txtENTERTotal: -5,748.583\nAverage: -57.486\n
Test Case 2
Please enter the file name: \ndouble_input2.txtENTERTotal: 112,546.485\nAverage: 56.273\n
Test Case 3
Please enter the file name: \ndouble_input3.txtENTERFile 'double_input3.txt' does not exist.\nPlease enter the file name again: \ndouble_input1.txtENTERTotal: -5,748.583\nAverage: -57.486\n
arrow_forward
reads an external character file and passes it to a list variable. Returns a list containing the words in the file as the return value of the function python functions _read_file_():
text inside:vejOnVacnesdsavWurndasorsdadsadaGhahidBejAcRenfacimJsadsadaiOnsOcsGebposAfAtOcFipswoukVuvaygdyswot
arrow_forward
This C++ mini project on STUDENT REPORT CARD has student class with
data members like roll no, name, marks and grade. Member functions in this
class are used for accept/ display details of students and a function to calculate
grade based on marks obtained by student. Student Records are stored in
binary file.This menu driven program illustrates read, write, search, modify and
delete operations in binary file.
ENTRY MENU
MAIN MINU
1.CREATE STUDENT RECORD
01. RESULI MENU
82. ENTRY/EDIT MENU
2.DISPLAY ALL STUDENTS RECORDS
3.SEARCH STUDENT RECORD
4. MODI FY STUDENT RECORD
83. EXIT
5. DELETE STUDENT RECORD
Please Select Your 0pt ion (1-3>
6. BACK TO MAIN MENU
Please Enter Your Cho ice (1-6>-
Enter The rol nunber of student 104
DISPLAY ALL RECORD !!!
Enter The Nane of student Sulabh
Roll Nunber of Student : 181
Nane of student Kusun
Marks in Physics : 56
Marks in Chenistry : 67
Marks in Maths: 78
Marks in English : 55
Marks in Conputer Science : ?1
Enter The narks in phys ics out 188 : 78…
arrow_forward
C programming language
Topic
: Input/Output
Program
: Product list (product.c)
Definition : The program reads a series of items form a file and displays the data in columns. The
program obtains the file name from the command line. Each line of the file will have the following
form: item, mm-dd-yyyy, price
For example, suppose that the file contains the following lines:
123, 12.00, 12/25/2006
124, 18.30, 1/10/2020
Expected output:
Item
Unit
Purchase
Price
Date
123
$ 12.00
12/25/2006
124
$ 18.30
1/10/2020
arrow_forward
Program Description:in C language
The project is a student management system which maintains student records in a simple text file.
Your task is to write a program to save a list of students records in a FILE and then perform several operations on this FILE.
Your program will ask user to choose the option from a menu.
The 3 major function in menu are: ADD STUDENT
FIND STUDENT
PRINT LIST
Exit
How it Works
The menu is handled by do while and switch statement.
Sample output
The Methods to be implemented are as follows:
1. ADDSTUDENT
This method will add a new student to the file.
It takes 3 parameters ( student name, id, and GPA).
Your program must ask the user to enter the details of new students: Name, ID and GPA
2. FINDSTUDENT
This method will search for a student with his/her id in the file.
If the student is found it will print her/his record to the output.
If the student is not found it will print “There is no record of this student in this system”
3. PRINTLIST
This method will…
arrow_forward
Java Problem
The teacher at a school needs help grading an exam with a number of True/False questions. The students’ IDs and test answers are stored in a file. The first entry of the file contains the answer to the test in the form:
TTFTFTTTFTFTFFTTFTTF
Every other entry in the file is the student’s ID, followed by a blank, followed by the students’ response. For instance, the entry:
ABC54102 T FTFTFTTTFTTFTTF TF
The student’s ID is ABC54102, answer to question 1 is True, the answer to question 3 is False. Also, the student did not answer question 2 and question 18. The exam has 20 questions. Here is the grading policy: each correct answer is awarded two points, each wrong answer get -1 point, and no answer gets 0 point. Write a program that processes the test data. The output should be the student’s ID, followed by the answers, followed by the test score (total points), followed by the test grade. Assume the following grade scale will be used: 90%-100%, A; 80%-89.99%, B; 70%-79.99%,…
arrow_forward
JAVA PPROGRAM ASAP
Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases.
The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram.
Chapter 9. PC #10. Word Counter (page 610)
Write a program that asks the user for the name of a file. The program should display the number of words that the file contains.
Input…
arrow_forward
Problem description
Write a program that will read in a file of student academic credit data and create a list
of students on academic warning. The list of students on warning will be written to a file.
Each line of the input file will contain the student name (a single String with no spaces), the
number of semester hours earned (an integer), the total quality points earned (a double).
The program should compute the GPA (grade point or quality point average) for each student
(the total quality points divided by the number of semester hours) then write the student
information to the output file if that student should be put on academic warning. A student
will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester
hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other
students. Do the following:
1. Create a text data file "students.dat". The following shows part of a typical data file:
Smith 27 83.7
Jones 21 28.35…
arrow_forward
Problem description
Write a program that will read in a file of student academic credit data and create a list
of students on academic warning. The list of students on warning will be written to a file.
Each line of the input file will contain the student name (a single String with no spaces), the
number of semester hours earned (an integer), the total quality points earned (a double).
The program should compute the GPA (grade point or quality point average) for each student
(the total quality points divided by the number of semester hours) then write the student
information to the output file if that student should be put on academic warning. A student
will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester
hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other
students. Do the following:
arrow_forward
A-Language- Python
Write a fully functioning program that correctly uses a list, reads, and writes from/to an external file.
Megan owns a small neighborhood coffee shop, and she has fifteen employees who work as baristas. All of the employees have the same hourly pay rate. Megan has asked you to design a program that will allow her to enter the number of hours worked by each employee and then display the amounts of all the employees’ gross pay. You determine that the program should perform the following steps:
The text that is in the file is stored as one sentence. Incorporate the code that reads the file’s contents and calculates the following:
total number of words in the file
total average number of words per sentence
total number of characters in the file
total average number of characters per sentence
Use function(s) to accommodate this word and character analysis of the file
B
For each employee:
Get the employee name from the file named employee_names.txt (attached in…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- Rectangle's Length and Width Code in C language // WARNING: Do not add, remove, or change anything before the line 19 of this file.// Doing so will nullify your score for the activity. #include <stdio.h>#include "rectangle.h" int get_length(Rectangle *rect);int get_width(Rectangle *rect); int main() { int ur_x, ur_y, ll_x, ll_y; printf("UR's X: "); scanf("%d", &ur_x); printf("UR's Y: "); scanf("%d", &ur_y); printf("LL's X: "); scanf("%d", &ll_x); printf("LL's Y: "); scanf("%d", &ll_y); // TODO: Initialize the points here // Point ... // TODO: Initialize the rectangle here // Rectangle ... // TODO: Call the get_length here int len = ___; printf("\nLength: %d", len); // TODO: Call the get_width here int wid = ___; printf("\nWidth: %d", wid); return 0;} // TODO implement get_lengthint get_length(Rectangle *rect) { return 0;} // TODO implement get_widthint get_width(Rectangle *rect){ return 0;} refer to pics for instructionsarrow_forwardDebug thisarrow_forwardProgramming language is C#arrow_forward
- C++ Languagearrow_forwardCan you please help me do this program, its for a class called Object Oriented Programmingarrow_forwardC++ Programming. Associative and unordered associative containers. Associative containers (set, map, multiset, multimap). • When executing a given task, the input values must be read from a text file. Task : Create a program that deletes a set of elements from a single word of a given string type and creates a second set of elements that consist of a single word, and also displays it on the screen.arrow_forward
- instruction: C++ languagearrow_forwardCOMPUTER SCIENCE 130 JAVA PROGRAM Chapter 4. Homework Assignment (read instructions carefully) Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits): Total: nnnnn.nnn Average: nnnnn.nnn Class name: FileTotalAndAverage double_input1.txt double_input2.txt PLEASE FIX AND MODIFY THIS JAVA SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASES. RIGHT NOW IT SAYS 0 OUT 3 PASSED. THE PICTURES THAT I PROVIDED PROOF THAT WHEN I UPLOAD IT TO HYPERGRADES IT FAILS TEST CASSES. THANK YOU. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.InputMismatchException;import java.util.Locale;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String…arrow_forwardcreateDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles. 2. Reads the profiles from the input file. 3. For each person in the file 1. creates a Profile object with the information from file (see input file format below). 2. insert the newly created profile into the next position in the database array (instance variable).arrow_forward
- JAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…arrow_forwardAssignment Submission Instructions:This is an individual assignment – no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows:/* ******************************************************************************** * Name: YourNameGoesHere * * Class: CST 235 * * Section: * * Date: * * I have not received or given help on this assignment: YourName * ***********************************************************************************/USE RetailDB;####### Tasks: Write SQL Queries ######### -- Task 1 (Customer Information):-- List your SELECT statement below. Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQLarrow_forwardIn python please! I am strugglingarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning