Lab 1
.doc
keyboard_arrow_up
School
Algonquin College *
*We aren’t endorsed by this school
Course
8283
Subject
Computer Science
Date
Dec 6, 2023
Type
doc
Pages
2
Uploaded by SargentTapir3890
CST 8283
Lab 1
Student Name
__Guleed Hassan
__________________________
Student
Number
____041053336
____
Lab section ___301
___
PROBLEM SCENARIO
You are to draft the Hierarchy (Function or Structure Chart) for the following
problem. Use the next page to record your draft Hierarchy Chart.
A file is to be created on disk from data entered at the keyboard. The disk file (to
be called STUDENT REGISTRATION will contain STUDENT records
Refer to
Record Structure
and
Process Requirements
below for details.
Process Requirements
A prompt is required to ask whether a record is to be entered.
The first time this prompt will be issued will be in the Initiation portion of the
hierarchy chart logic.
As each record is entered at the keyboard it is to be written to an external file.
Each time through the mainline loop, the program should prompt whether a
record is to be entered and if so, prompt for the entry of the fields required.
The fields required are :
Student Number;
Student Name;
Student Email
Once all records have been entered and written to the file, the file will be closed.
Page
1
of
2
CST 8283
Lab 1
Student Name
__Guleed Hassan
__________________________
Student
Number
____041053336
____
Lab section ____301
__
Page
2
of
2
STUDENT
REGISTRATION FILE
CREATED
INITIATION
Will a record be entered?
Keyboard Entry
Prompt: “Will a record be
entered?”
CLOSING
Once all records are entered
and written close file.
Yes
Student Number
Student Name:
Student Email
No
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
Part B - reading CSV files
You will need a Python repl to solve part B.
Define a Python function named cheapest_rent_per_state that has one parameter. The parameter is a string representing the name of a CSV file. The CSV file will be portion of a dataset published by the US
government showing the median (middle) rent in every county in the US. Each row in the CSV file has the same format
Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code
The data in the Area Name and State Code columns are text. The data in all of the other columns are decimal numbers.
Your function will need to use the accumulator pattern to return a dictionary. The keys of that dictionary will be the state codes read in from the file (state codes are at index 6). For each key in the dictionary, it's
value should be the smallest median rent for an efficiency in that state (median rents for an efficiency are at index 1).
Important Hints:
* You will really, really want to use the built-in csv…
arrow_forward
Create a structure course with some attributes i.e course_ID, course_title, credit_hrs etc.. Then Implement
following 5 functions (Known as CRUDS operations which means CREATE, READ, UPDATE, DELETE,
SEARCH operations):
1. addAStudent
2. updateAStudent
3. deleteAStudent
4. searchAndDisplayAStudent
5. displayAllstudents
After that, create an array of 5 courses in main function. Create a menu in main function to enable user to
select and perform the operations we created above. Program must not exit until and unless user wants to
do so.
Result:
Sample Menu:
Main Menu
---------------
Press 1 to add a Course
Press 2 to update a Course
Press 3 to delete a Course
Press 4 to search and display a Course
Press 5 to display all Courses
Press e to exit the program
Write this programme in c++
arrow_forward
get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary.
arrow_forward
PYTHON PROGRAMMING.
USE PROVIDED STARTING CODE TO COMPLETE THIS TASK.
Create a glossary (dictionary) of technical terms and definitions. It will be set up as a Python dictionary structure. The file glossary_starter.py is a complete starter framework for the assignment. It includes some initial values for the dictionary. It is long because most of the code has already been written for you.
Your task is to complete the five individual functions for adding and deleting terms, looking up terms, listing them, and printing out both the terms and definitions. These functions are all short, just a couple of lines, and use basic dictionary methods and techniques.
PROVIDED CODE:
""" Program framework for module 9 graded program Creating a dictionary of technical terms and basic definitions key - the word to define value - the definition of the word Note: This isn't a usable application, as new data added is just temporary."""
tech_terms = { "dict": "stores a key/value pair",…
arrow_forward
+||
8
Exercise 1 (2%)
Create an anonymous block that displays a course list. Declare a cursor and use the OPEN,FETCH, and
CLOSE cursor statements to access the cursor. Use the %ROWTYPE attribute for the cursor.
Output:
Course Code
Course Title
Accounting Theory
Microeconomics
Financial Accounting
Anthropology
Introduction to Business
Businéss Planning
Web Technologies I
Programming Logic
Web Technologies II
Python Programming
Web Technologies III
Database Design & SQL
Communications I
ACC104
ACC205
ANT100
BUS100
BUS230
CIS100
CIS105
CIS200
CIS225
00ESI)
CIS400
ENG101
ENG201
GEO101
MGT410
Communication II
The Physical Environment
Human Resources Management
Project Management
Algebra
Geometry
Nursing Theory I
Nursing Theory II
MGT415
MTH120
MTH400
NSG130
NSG230
-19°C Mostly sunny ^ o
prt sc
home
end
insert
delete
F6
F7
F10
F11
F12
81
)
(
num
backspace
lock
6
}
{
]
enter
7.
shift
B.
/
dn 6d
up 6d
alt
ctrl
>
arrow_forward
IN C++
Write a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements:
Each row contains the title, rating, and all showtimes of a unique movie.
A space is placed before and after each vertical separator ('|') in each row.
Column 1 displays the movie titles and is left justified with a minimum of 44 characters.
If the movie title has more than 44 characters, output the first 44 characters only.
Column 2 displays the movie ratings and is right justified with a minimum of 5 characters.
Column 3 displays all the showtimes of the same movie, separated by a space.
Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows.
Hints: Use the find() function to find the index of a comma in each…
arrow_forward
Some rows of the STUGRADE table of a school are shown below:
STU_CODE
CLS_CODE
GRADE
YEAR
291
111
3.1
2010
938
101B
2.3
2011
931
M101
3.3
2040
291
M101
3.4
2018
190
111
2.0
2021
931
321
3.9
2003
Suppose that STU_CODE is the student code (foreign key) and CLS_CODE is the class code (foreign key). Which of the following computes the average for each year of the student with code 931?
a.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY YEAR
b.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931.
c.
SELECT AVG(GRADE) FROM STUGRADE GROUP BY STU_CODE = 931
d.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY AVG(GRADE)
arrow_forward
Attention>>>>>>>>> project should written in C languages In the project, a student affairs information system simulation is requested to be made using structures (“struct”), linked lists (“linked list”) and files (“file”). According to this;
a) Create a structure called a course. The members of this structure are code, name, instructor, term (can take Spring or Fall values), year, and a course pointer. Functions with prototype void insertCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code), char* deleteCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code) that will operate on course data structure elements, since the courses taken by the students are to be kept with a linked list. write. While writing the insertCourse() function, prevent the same student from taking the same course more than once.
b) Create a structure called student. Let the members of this structure be id, name, surname, department, class (can take B.Sc., M.Sc., Ph.D.),…
arrow_forward
For this assignment, you will create a glossary (dictionary) of technical terms and definitions. It will be set up as a Python dictionary structure. The file glossary_starter.py is a complete starter framework for the assignment. It includes some initial values for the dictionary. It is long because most of the code has already been written for you.Your task is to complete the five individual functions for adding and deleting terms, looking up terms, listing them, and printing out both the terms and definitions. These functions are all short, just a couple of lines, and use basic dictionary methods and techniques.
""" Program framework for module 9 graded program Creating a dictionary of technical terms and basic definitions key - the word to define value - the definition of the word Note: This isn't a usable application, as new data added is just temporary."""
tech_terms = { "dict": "stores a key/value pair", "list": "stores a value at each index",…
arrow_forward
Part C - advanced file reading
You will need a Python repl to solve part C.
Define a Python function named expensive_counties that has two parameters. The first parameter is a string representing the name of a text file. Each line of this text file will be a state code. The second
parameter is a string representing the name of a CSV file. The CSV file will be portion of the US government's dataset documenting median rents in each US county. Each row in the CSV file has the format:
Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code
Your function will need to use the accumulator pattern to return a new list. You will need to add to this list the Area Name from every row that meets 2 criteria:
(1) The state code (the column at index 6) was a line in the text file named in the first parameter; AND
(2) The median rent on a 1-bedroom apartment (the column at index 2) is over 1000.
Important Hints:
* You will really, really want to use the built-in csv library…
arrow_forward
Programming Language BSL
Purpose To design a small program using structured data.
Expectations
You should submit a single .rkt file containing your responses to all exercises via the Handin Server. We accept NO email submissions. Failure to submit a .rkt file will result in a 0.
You are only allowed to use the language specified at the top of this page: failure to do so will result in a 0. You should only use the concepts that we have covered in class so far.
Your code MUST conform to the guidelines outlined in the style guide on the course website. The style guide will be updated as the semester progresses so please remember to read it before submitting each assignment.
You must follow all the steps of the design recipe when completing this assignment.
Graded Exercises
Exercise 1 Design a data definition for a mathematical expression. Your data definition should be able to handle the addition, subtraction, and multiplication of any two integers. You do not need to…
arrow_forward
Print Person Information from file
In this lab you are asked to complete the function : print_person_from_file(person_name, filename). This function should
read in data from the file filename and print the information for person_name if it is found in the file.
The file filename contains lines, in comma separated format (with a 'csv' extension) For each line, the items in each field are as follows:
Field
1
3
4
Name
Place of Birth Date of Birth Children
For Children:
• a person can have 0, 1 or multiple Children
Multiple children are semi-colon separated
If a person has no children the field contains 'NA'
For example, consider the following lines froma .csv file, where Fletcher_Margaret has 3 children, and Baker_Jill has 0 children
(field 4 contains the string 'NA')
Fletcher Margaret,Sydney,30-09-1921,Green Bob;Green Nancy;William Tom
Baker_Jill, Melbourne,08-09-1973, NA
Format for Printing
If the person_name is found in the file, the format for printing the person information is as…
arrow_forward
Task 4 Get Binary 2:
For task 4
Implement the get_bin_2 function as directed in the comment above the function. If the directions are unclear, run the code, and look at the expected answer for a few inputs. For your solution, you should refer to your solution for Task 2 to get the general idea for Task 4, and you should use largest_po2_le in your solution (think about why this might be useful in terms of the binary representation). Make sure you build the string for 0 and negative numbers correctly. The same restrictions apply from Task 2.
Code#include <stdio.h>#include <stdbool.h>#include <stdlib.h>
// BEGIN STRINGBUILDER IMPLEMENTATION
// This code is a very rudimentary stringbuilder-like implementation// To create a new stringbuilder, use the following line of code//// stringbuilder sb = new_sb();//// If you want to append a character to the stringbuilder, use the// following line of code. Replace whatever character you want to// append where the 'a' is.////…
arrow_forward
INSTRUCTIONS:
• You are to answer this activity individually.
• You are to create a Python application that makes use of inputs, outputs, and sequence structures in Python.
• It must meet all of the following requirements:
• The application must create a list with exactly 10 items. The contents and type of list will be up to the student (e.g. Phone Brands, Types of Shoes, Shopping Apps). The application must first display the list
after which the application must remove 5 random items from the list. The application must then show the updated list with 5 of the items removed. After this is done, the application must add 7 new items to
the list. These items must be completely new and not the ones that were on the list initially. The application must then output the updated list with the added items. The application must then reverse the list
and then display the updated list after it has been reversed.
• The application must create a tuple with exactly 10 items. The contents and type of…
arrow_forward
Define the function number_in_trophic_class(tli3_values, classification) which takes a list of trophic level index values and a trophic classification, returning the number of lakes in that trophic class. For this version of the question you MUST use a list comprehension. You cannot use a for loop or while loop in your answer.
Notes:
You must include, and use/call your trophic_class function in your submission.
Your tropic_class function must work in the same way it did for Question 2.
You can assume that classification will always be valid, i.e. it will always be one of the states in the following list:
['Hypertrophic', 'Supertrophic', 'Eutrophic', 'Mesotrophic', 'Oligotrophic', 'Microtrophic', 'Ultra-microtrophic']
There are several ways to proceed, but you will probably find either the len function or the count method of the list class useful in conjunction with your list comprehension.
For example:
Test
Result
tli3_list_1 = [4.1061, 2.54561, 4.16276, 2.33801,…
arrow_forward
Lab 1 – Using Fundamental Data Structures
Purpose: The purpose of this Lab assignment is to:
Design and develop Applications that incorporate fundamental data structures such as:
Singly Linked Lists
Doubly Linked Lists
Circularly Linked Lists
References: Read the course’s text chapter 3 and the lecture slides. This material provides the necessary information that you need to complete the exercises.
Be sure to read the following general instructions carefully:
- This assignment must be completed individually by all the students.
- See the naming and submission rules at the end of this document
Exercise 1
If your first name starts with a letter from A-J inclusively:
Add a method swapTwoNodes to SinglyLinkedList class from week 2 lecture examples. This method should swap two nodes node1 and node2 (and not just their contents) given references only to node1 and node2. The new method should check if node1 and node2 are the same node, etc. Write the main method to…
arrow_forward
Can you use Python programming language to to this question?
Thanks
arrow_forward
A very long line: What data structure or structures would you use to maintain a very long queue of records, each having an id (some sort of string). You need to be able to find the first item in O(1) time, add to the end in O(1), and remove items in O(1) time, given some id (not index), from anywhere in the line. Additionally, you need to be able to find an item in line in O(1) time and see what items are near it (in front of or in back of) in O(1), possibly more (each is O(1) time). Explain what is stored in each Data Structure (“record (with id possibly)”, “pointers to ______”).
arrow_forward
There are four fundamental operations for accessing data structures. Many data structures accomplish an update by combining which of the
following operations?
a. Initialize and, Construct
b. Remove and Set
O c. Setup and TearDown
d. Delete and Insert
arrow_forward
Assume that grade records are dictionaries that always contain three keys: "Assi gnments", "Midterm“,
and "Final". An example of such a record might be:
{"Assignments" :[99, 98, 100, 100, 80], "Midterm" :95, "Final" : 90}
Note that the "Assignments" key is associated with a list, rather than a single integer; this is because there
were 5 assignment grades in the class. All numeric values will be in the range 0 to 100 (i.e. they are percent
ages).
Also assume that dictionary_students is a dictionary in which the keys are student names and the
values are grade records.
Define a function called final_grades () that accepts dictionary_students as its only parameter. The
function should add a new key-value pair to each grade record in dictionary_students. The key for
this pair should always the be word "Grade", and the value should be the student's final overall grade in the
class. The final grade can be calculated according to the following information from the course syllabus:
• Each…
arrow_forward
Looking for this in Python, please.
Shopping list assignment (Parallel Array)
Create three global variables with the proper data types:
sub_totaltotal_pricesales_tax
Sales tax is 9.5%
Seven items minimum
Create a shopping list (List, Tuple or Dictionary) of your choice (Items in list)
Create a price list (Price for each item in shopping list)
Create and print your parallel array (match each item to its price)
Print the list with its index numbers
Select one or more items from the shopping list using the index number
Print your selected items with price
Print sub total (base price of item(s) before tax)
Print sales tax amount (before adding it into total price)
Calculate and print total price with tax included. (this is what you would pay walking out the door)
Round to two decimal points
arrow_forward
PYTHON QUESTION
This assignment requires you to create a dictionary by reading the text file created for the Chapter 6 assignment. The dictionary should have player names for the keys. The value for each key must be a two-element list holding the player's goals and assists, respectively. See page 472! Start with an empty dictionary. Then, use a loop to cycle through the text file and add key-value pairs to the dictionary. Close the text file and process the dictionary to print the stats and determine the top scorer as before. In fact, much of the code used in program6_2.py can be copied and used for this program. Printing the stats for each player is the most challenging part of this program. To master this, refer to the examples in the zip file that can be downloaded from the "Dictionary values can be lists" link in the "Learn Here" part of this module. NOTE: you do not need to submit the text file. Submit just this program. The required output should be the same well-formatted table…
arrow_forward
Python Programming Problem: Simple Soccer Point TableThe programmer will design a simple point table lookup and update application. The table contains some basic information: team_name, match_played, win, draw, loss, point and rank.
Design Solution:1. English Premier League is a prestigious soccer league. Here is the result of its one session.
Man. City|38|32|2|4|98|1Liverpool|38|30|7|1|97|2Chelsea|38|21|9|8|72|3Tottenham|38|23|2|13|71|4Arsenal|38|21|7|10|70|5
2. Hypothetically, you have been assigned to design a simple lookup software for prestigious ‘English Premier League’ from a given point table. The point table contains team_name, match_played,win, draw, loss, points and rank.
3. The input file, ‘previous_result.txt’ has been provided to you above the top 5 teams in 2018-19 session. Your software needs to be able to search and update the point table based on user input. For example: The first time Chelsea played 38, the second time it changed (based on user input) to 40 and so…
arrow_forward
1.Description: You are given a list of queries, each consisting of three integers: a, b, and k. Your task is to perform a series of operations on an array of size n such that each element in the array is incremented by k in a specific range defined by a and b..
Coding expansion.
arrow_forward
Estimated Completion Time: 2 minutes
You are now working for Prof. Midas on a research project. You are given this piece of code to review which is
intended to be a better and faster implementation of a function that checks whether a given key is in a
dictionary (i.e., key lookup). You have to present your findings to
Prof. Midas. Select all the findings which you will NOT present (i.e., select all answers which are FALSE).
def key_in_dict(d, k):
for item in d:
if k == item:
return True
return False
This code would always be slower than the builtin key lookup Python provides.
O A key lookup in a dictionary in Python is generally faster than determining whether a value is in a list.
O This code is way faster and will be included in the next version of Python (version 4.1).
The code is incorrect from a functional perspective, the True and False should be switched.
This code could be replaced with one line: return k in d
O The code is correct and would always perform faster than the…
arrow_forward
PROGRAMMING LANGUAGE: C++
Implement another class with name UniversityClass which is composed of one teacher and multiple students(use student array) as data members. Another data member of UniversityClass is CourseName that is just a string data member. Write a function in UniversityClass to take Teacher Name, Student names and course name from user. Insert these records in a text file and print screenshot of that text file.
Print UniversityClass code here.
Print main function here.
Print screenshot of text file here.
arrow_forward
Problem Definition
You are provided with a text file (employees.txt) containing a number of text lines. Each line contains a record of one
employee. Each record has three attributes:
Title: string, Prof. (Professor) or Dr. (Doctor).
First and Last names: string.
Salary: float number.
The attributes are separated by the character (',). Figure 1.a, 1.b, and 1.c show a sample of employees.txt files.
Dr., Julia Scott, 141518
Dr., Julia Scott, 141518
Prof.,Joan Stewart, 111673
Mr.,Ali Al-shukaili,122311
Prof., Sana Al-Abri, 131673
Prof.,Joan Stewart
Dr., Fadi A1-Rasdhi, 153790
Ms., Salwa Al-Youssfi, 111675
Dr., Daniel Cooper, 153790
Dr., Lillian Brown, unknown
Dr. :Benjamin Russell:117642
Dr., Daniel Cooper, 153790
Dr., Lillian Brown, 67251
Dr., Benjamin Russell,117642
Prof., Patrick Bailey, 72305
Dr., Ralph Flores, 118457
Dr., Douglas Flores, 181793
Dr., Lillian Brown, 67251
Figure 1.b: A sample of the text file 'employees.txt"
Figure 1.a: A sample of the text file
'employees.txt' without…
arrow_forward
3. By python Create a list dynamically in Python. It should have data items of all datatypes. The size should be 10.
arrow_forward
In C Language
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Related Questions
- Part B - reading CSV files You will need a Python repl to solve part B. Define a Python function named cheapest_rent_per_state that has one parameter. The parameter is a string representing the name of a CSV file. The CSV file will be portion of a dataset published by the US government showing the median (middle) rent in every county in the US. Each row in the CSV file has the same format Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code The data in the Area Name and State Code columns are text. The data in all of the other columns are decimal numbers. Your function will need to use the accumulator pattern to return a dictionary. The keys of that dictionary will be the state codes read in from the file (state codes are at index 6). For each key in the dictionary, it's value should be the smallest median rent for an efficiency in that state (median rents for an efficiency are at index 1). Important Hints: * You will really, really want to use the built-in csv…arrow_forwardCreate a structure course with some attributes i.e course_ID, course_title, credit_hrs etc.. Then Implement following 5 functions (Known as CRUDS operations which means CREATE, READ, UPDATE, DELETE, SEARCH operations): 1. addAStudent 2. updateAStudent 3. deleteAStudent 4. searchAndDisplayAStudent 5. displayAllstudents After that, create an array of 5 courses in main function. Create a menu in main function to enable user to select and perform the operations we created above. Program must not exit until and unless user wants to do so. Result: Sample Menu: Main Menu --------------- Press 1 to add a Course Press 2 to update a Course Press 3 to delete a Course Press 4 to search and display a Course Press 5 to display all Courses Press e to exit the program Write this programme in c++arrow_forwardget_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary.arrow_forward
- PYTHON PROGRAMMING. USE PROVIDED STARTING CODE TO COMPLETE THIS TASK. Create a glossary (dictionary) of technical terms and definitions. It will be set up as a Python dictionary structure. The file glossary_starter.py is a complete starter framework for the assignment. It includes some initial values for the dictionary. It is long because most of the code has already been written for you. Your task is to complete the five individual functions for adding and deleting terms, looking up terms, listing them, and printing out both the terms and definitions. These functions are all short, just a couple of lines, and use basic dictionary methods and techniques. PROVIDED CODE: """ Program framework for module 9 graded program Creating a dictionary of technical terms and basic definitions key - the word to define value - the definition of the word Note: This isn't a usable application, as new data added is just temporary.""" tech_terms = { "dict": "stores a key/value pair",…arrow_forward+|| 8 Exercise 1 (2%) Create an anonymous block that displays a course list. Declare a cursor and use the OPEN,FETCH, and CLOSE cursor statements to access the cursor. Use the %ROWTYPE attribute for the cursor. Output: Course Code Course Title Accounting Theory Microeconomics Financial Accounting Anthropology Introduction to Business Businéss Planning Web Technologies I Programming Logic Web Technologies II Python Programming Web Technologies III Database Design & SQL Communications I ACC104 ACC205 ANT100 BUS100 BUS230 CIS100 CIS105 CIS200 CIS225 00ESI) CIS400 ENG101 ENG201 GEO101 MGT410 Communication II The Physical Environment Human Resources Management Project Management Algebra Geometry Nursing Theory I Nursing Theory II MGT415 MTH120 MTH400 NSG130 NSG230 -19°C Mostly sunny ^ o prt sc home end insert delete F6 F7 F10 F11 F12 81 ) ( num backspace lock 6 } { ] enter 7. shift B. / dn 6d up 6d alt ctrl >arrow_forwardIN C++ Write a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each…arrow_forward
- Some rows of the STUGRADE table of a school are shown below: STU_CODE CLS_CODE GRADE YEAR 291 111 3.1 2010 938 101B 2.3 2011 931 M101 3.3 2040 291 M101 3.4 2018 190 111 2.0 2021 931 321 3.9 2003 Suppose that STU_CODE is the student code (foreign key) and CLS_CODE is the class code (foreign key). Which of the following computes the average for each year of the student with code 931? a. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY YEAR b. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931. c. SELECT AVG(GRADE) FROM STUGRADE GROUP BY STU_CODE = 931 d. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY AVG(GRADE)arrow_forwardAttention>>>>>>>>> project should written in C languages In the project, a student affairs information system simulation is requested to be made using structures (“struct”), linked lists (“linked list”) and files (“file”). According to this; a) Create a structure called a course. The members of this structure are code, name, instructor, term (can take Spring or Fall values), year, and a course pointer. Functions with prototype void insertCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code), char* deleteCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code) that will operate on course data structure elements, since the courses taken by the students are to be kept with a linked list. write. While writing the insertCourse() function, prevent the same student from taking the same course more than once. b) Create a structure called student. Let the members of this structure be id, name, surname, department, class (can take B.Sc., M.Sc., Ph.D.),…arrow_forwardFor this assignment, you will create a glossary (dictionary) of technical terms and definitions. It will be set up as a Python dictionary structure. The file glossary_starter.py is a complete starter framework for the assignment. It includes some initial values for the dictionary. It is long because most of the code has already been written for you.Your task is to complete the five individual functions for adding and deleting terms, looking up terms, listing them, and printing out both the terms and definitions. These functions are all short, just a couple of lines, and use basic dictionary methods and techniques. """ Program framework for module 9 graded program Creating a dictionary of technical terms and basic definitions key - the word to define value - the definition of the word Note: This isn't a usable application, as new data added is just temporary.""" tech_terms = { "dict": "stores a key/value pair", "list": "stores a value at each index",…arrow_forward
- Part C - advanced file reading You will need a Python repl to solve part C. Define a Python function named expensive_counties that has two parameters. The first parameter is a string representing the name of a text file. Each line of this text file will be a state code. The second parameter is a string representing the name of a CSV file. The CSV file will be portion of the US government's dataset documenting median rents in each US county. Each row in the CSV file has the format: Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code Your function will need to use the accumulator pattern to return a new list. You will need to add to this list the Area Name from every row that meets 2 criteria: (1) The state code (the column at index 6) was a line in the text file named in the first parameter; AND (2) The median rent on a 1-bedroom apartment (the column at index 2) is over 1000. Important Hints: * You will really, really want to use the built-in csv library…arrow_forwardProgramming Language BSL Purpose To design a small program using structured data. Expectations You should submit a single .rkt file containing your responses to all exercises via the Handin Server. We accept NO email submissions. Failure to submit a .rkt file will result in a 0. You are only allowed to use the language specified at the top of this page: failure to do so will result in a 0. You should only use the concepts that we have covered in class so far. Your code MUST conform to the guidelines outlined in the style guide on the course website. The style guide will be updated as the semester progresses so please remember to read it before submitting each assignment. You must follow all the steps of the design recipe when completing this assignment. Graded Exercises Exercise 1 Design a data definition for a mathematical expression. Your data definition should be able to handle the addition, subtraction, and multiplication of any two integers. You do not need to…arrow_forwardPrint Person Information from file In this lab you are asked to complete the function : print_person_from_file(person_name, filename). This function should read in data from the file filename and print the information for person_name if it is found in the file. The file filename contains lines, in comma separated format (with a 'csv' extension) For each line, the items in each field are as follows: Field 1 3 4 Name Place of Birth Date of Birth Children For Children: • a person can have 0, 1 or multiple Children Multiple children are semi-colon separated If a person has no children the field contains 'NA' For example, consider the following lines froma .csv file, where Fletcher_Margaret has 3 children, and Baker_Jill has 0 children (field 4 contains the string 'NA') Fletcher Margaret,Sydney,30-09-1921,Green Bob;Green Nancy;William Tom Baker_Jill, Melbourne,08-09-1973, NA Format for Printing If the person_name is found in the file, the format for printing the person information is as…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage