Note You will receive a list of queries to the system, and the final output should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Note You will receive a list of queries to the system, and the final output should be an array of strings representing the returned values of all queries. Each query will only call one operation. Level 1 Initially, the course registration system does not contain any courses, so course creation and registration operations are introduced first. RE . CREATE_COURSE <courseId> <name> <credits> -should add a course called name with course ID being courseId weighing credits credits. • A course ID consists of 6 symbols the first 3 are letters and denote the department, and the last three are digits forming a 3-digit number. • Credits are simply units that show the amount of coursework. . If there is another course with the same name or courseId, the method should return "false" Otherwise, it should create a course and return "true" REGISTER FOR COURSE <studentId> courseId>- should register a course with a course ID courseId for a student with a student ID studentId. A student cannot register for the same course twice. A student cannot register for more than 24 credits (the total sum of credits of a student's courses cannot be strictly bigger than 24). Return "true" if the student was successfully registered for the course. Otherwise, return "false" Note You will receive a list of queries to the system, and the final output should be an array of strings representing the returned values of all queries. Each query will only call one operation. Level 1 Initially, the course registration system does not contain any courses, so course creation and registration operations are introduced first. RE . CREATE_COURSE <courseId> <name> <credits> -should add a course called name with course ID being courseId weighing credits credits. • A course ID consists of 6 symbols - the first 3 are letters and denote the department, and the last three are digits forming a 3-digit number. • Credits are simply units that show the amount of coursework. . If there is another course with the same name or courseId, the method should return "false" Otherwise, it should create a course and return "true" REGISTER FOR COURSE <studentId> courseId>- should register a course with a course ID courseId for a student with a student ID studentId. A student cannot register for the same course twice. A student cannot register for more than 24 credits (the total sum of credits of a student's courses cannot be strictly bigger than 24). Return "true" if the student was successfully registered for the course. Otherwise, return "false" E GS scrollable to the right): MORE 1 shows how these operations should work (the example section is queries = [ ["CREATE COURSE", "CSE220", "System Programming", "3"], ["CREATE COURSE", "CSE221", "System Programming", "4"], ["CREATE COURSE", "CSE220", "Computer Architecture", "3"], ["CREATE COURSE", "CSE300" "Introduction to Algorithms", "20"], ["CREATE_COURSE", "CSE330", "Operating Systems", "4"], ["REGISTER_FOR_ COURSE" "st001","CSE220"] ["REGISTER FOR_COURSE" ["REGISTER_FOR_COURSE" ["REGISTER_FOR_COURSE", Input/Output . Queries . "st001" the output should be ["true", "false", "false", "true", "true", "true", "false", "true", "false"] "st001","CSE300"], [execution time limit] 4 seconds (is) . [memory limit] 1 GB "CSE220"] "st001", "CSE330"] [input] array.array.string queries 2: 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 TESTS Note You will receive a list of queries to the system, and the final output should be an array of strings representing the returned values of all queries. Each query will only call one operation. Level 1 Initially, the course registration system does not contain any courses, so course creation and registration operations are introduced first. RE . CREATE_COURSE <courseId> <name> <credits> -should add a course called name with course ID being courseId weighing credits credits. • A course ID consists of 6 symbols the first 3 are letters and denote the department, and the last three are digits forming a 3-digit number. • Credits are simply units that show the amount of coursework. . If there is another course with the same name or courseId, the method should return "false" Otherwise, it should create a course and return "true" REGISTER FOR COURSE <studentId> courseId>- should register a course with a course ID courseId for a student with a student ID studentId. A student cannot register for the same course twice. A student cannot register for more than 24 credits (the total sum of credits of a student's courses cannot be strictly bigger than 24). Return "true" if the student was successfully registered for the course. Otherwise, return "false" Note You will receive a list of queries to the system, and the final output should be an array of strings representing the returned values of all queries. Each query will only call one operation. Level 1 Initially, the course registration system does not contain any courses, so course creation and registration operations are introduced first. RE . CREATE_COURSE <courseId> <name> <credits> -should add a course called name with course ID being courseId weighing credits credits. • A course ID consists of 6 symbols - the first 3 are letters and denote the department, and the last three are digits forming a 3-digit number. • Credits are simply units that show the amount of coursework. . If there is another course with the same name or courseId, the method should return "false" Otherwise, it should create a course and return "true" REGISTER FOR COURSE <studentId> courseId>- should register a course with a course ID courseId for a student with a student ID studentId. A student cannot register for the same course twice. A student cannot register for more than 24 credits (the total sum of credits of a student's courses cannot be strictly bigger than 24). Return "true" if the student was successfully registered for the course. Otherwise, return "false" E GS scrollable to the right): MORE 1 shows how these operations should work (the example section is queries = [ ["CREATE COURSE", "CSE220", "System Programming", "3"], ["CREATE COURSE", "CSE221", "System Programming", "4"], ["CREATE COURSE", "CSE220", "Computer Architecture", "3"], ["CREATE COURSE", "CSE300" "Introduction to Algorithms", "20"], ["CREATE_COURSE", "CSE330", "Operating Systems", "4"], ["REGISTER_FOR_ COURSE" "st001","CSE220"] ["REGISTER FOR_COURSE" ["REGISTER_FOR_COURSE" ["REGISTER_FOR_COURSE", Input/Output . Queries . "st001" the output should be ["true", "false", "false", "true", "true", "true", "false", "true", "false"] "st001","CSE300"], [execution time limit] 4 seconds (is) . [memory limit] 1 GB "CSE220"] "st001", "CSE330"] [input] array.array.string queries 2: 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 TESTS
Expert Answer:
Answer rating: 100% (QA)
Solved by using Python Initialization Initialize empty data structures Initialize empty dictionaries ... View the full answer
Related Book For
Project management the managerial process
ISBN: 978-0073403342
5th edition
Authors: Eric W Larson, Clifford F. Gray
Posted Date:
Students also viewed these programming questions
-
Following are transactions for Ridge Company. March 21 Accepted a $11,100, 180-day, 10% note from Tamara Jackson in granting a time extension on her past-due account receivable. September 17 Jackson...
-
Once market research is concluded and the results are obtained, how do you proceed? What are the next steps in the procurement process
-
The site http://virtualpiano.net features an online player piano. If you click on the Key Assist menu just above the piano keyboard, and then Keyboard Keys, you will see that each key is labelled...
-
Table 2-5 Estonia Finland One Cell Phone 40 hours 16 hours Lumber (per board foot) 8 hours 4 hours Table 2-5 shows the number of labor hours required to produce a cell phone and a board foot of...
-
At the beginning of 2015, Bering Limited purchased three investments: Government of Alberta bonds, which are to be held to maturity; common shares in Atlas Inc., representing only 1% of the...
-
Water (50F) flows with a speed of 5 ft /s through a horizontal run of PVC pipe. The length of the pipe is 100 ft , and the pipe is schedule 40 with a nominal diameter of 2.5 inches. Calculate (a) The...
-
Portfolios are constructed to reduce risk for a given level of economic return. In this context, why would a company be interested in constructing an ecoefficiency portfolio?
-
The following are several accounts of the Graf Corporation at the end of 2007: Account Credit Balance Common stock , $10 par ............ $ 47,100 Bonds payable (due 2014) ........... 126,000 Premium...
-
Williams Products Inc. manufactures and sells a number of items, including school knapsacks. The company has been experiencing losses on the knapsacks for some time, as shown by the contribution...
-
Griffin and Lasky, Inc. (G&L), supplies industrial automation equipment and machine tools to the automotive industry. G&L recognizes revenue on its long-term contracts over time. Customer orders have...
-
25. h(x) = x+9x- 10 has a root at x = 1. Without graphing h, show that h has no other roots.
-
Tamarisk Corporation issued 2,100 $1,000 bonds at 103. Each bond was issued with one detachable stock warrant. After issuance, the bonds were selling in the market at 97, and the warrants had a...
-
Bath Manufacturing Company uses the weighted average method for process costing. Bath produces processed food products that pass through three sequential departments. The costs for Department 1 for...
-
A residential development of 280-house is being planned. Assumethat American Water Works Association (AWWA) average dailyhousehold consumption applies and that each house has 3 residents.Estimate the...
-
Quarry Ltd. is a mining company with several locations throughout Europe. Since its inception, they have always abided by the regulations of the various countries. With the introduction of...
-
A child's toy has a solid plastic sphere of radius 20cm that can be rotated about its center. Child A applies a force of 30N tangent to the edge of the sphere to cause it to rotate counter clockwise....
-
Let m be a natural number such that 3m divides 25! but 3m+1 does not divide 25! then m is equal to 25 20 8 10
-
What are the principal differences among asset liquidity management, liability management, and balanced liquidity management?
-
What are the likely outcomes if a change control process is not used? Why?
-
1. Make a list of the major deliverables for the project and use them to develop a draft of the work breakdown structure for the tournament that contains at least three levels of detail. What are the...
-
This chapter discussed the role of values and beliefs in forming an organizations culture. The topic of organization culture is big business on the Internet. Many companies use their Web pages to...
-
How do you allocate requirements?
-
How do you flow down requirements?
-
What is requirements flow down?
Study smarter with the SolutionInn App