Category | Assignment | Subject | Programming |
---|---|---|---|
University | Singapore University of Social Science (SUSS) | Module Title | ICT 133 Structured Programming |
Academic Year | 2025 |
---|
Develop and write complete full Python programs for each part, to perform the following tasks.
Enter investment amount: 150000
Enter the expected investment growth rate: 5 Enter the discount rate: 7.5
Enter Number of years: 5
Investment at end of year 5 is $191442.23 which is worth $133350.74 today
Run 1
Enter investment amount: 100
Invalid investment amount. The amount should be between 1000 and 200000
Run 2
Enter investment amount: 1000
Enter the expected investment growth rate: -1 Enter the discount rate: 3
Rates cannot be negative
Run 3
Enter investment amount: 1000
Enter the expected investment growth rate: 4
Enter the discount rate: 5 Enter number of years: -2
Year must be a positive number
Run 4
Enter investment amount: 1000
Enter the expected investment growth rate: 4 Enter the discount rate: 5
Enter number of years: 5
Investment at end of year 5 is $1216.65 which is worth $953.28 today
An example run is shown here with user inputs shown underlined:
Enter investment amount: 150000
Enter the expected interest rate: 5
Enter the discount rate: 6.5
Year | Value | at Year($) | Today’s worth($) |
0 | 150,000 | 150,000 | |
1 | 157,500 | 147,887 | |
2 | 165,375 | 145,804 | |
3 | 173,644 | 143,751 | |
4 | 182,326 | 141,726 | |
5 | 191,442 | 139,730 | |
6 | 201,014 | 137,762 | |
7 | 211,065 | 135,822 | |
8 | 221,618 | 133,909 | |
9 | 232,699 | 132,023 | |
10 | 244,334 | 130,163 |
Struggling ICT 133 Assignment? Deadlines Are Near?
Hire Assignment Helper Now!Define the following functions:
Enter investment amount: 10000
Enter the expected investment growth rate: 5
Enter the discount rate: 7
Year | Value | at Year($) | Today’s | worth($) | |
1 | 10,500 | 9,346 | |||
2 | 11,025 | 8,734 | |||
3 | 11,576 | 8,163 | |||
4 | 12,155 | 7,629 | |||
5 | 12,763 | 7,130 | |||
6 | 13,401 | 6,663 | |||
7 | 14,071 | 6,227 | |||
8 | 14,775 | 5,820 | |||
9 | 15,513 | 5,439 | |||
10 | 16,289 | 5,083 | |||
11 | 17,103 | 4,751 | (5 marks) |
Copy as text the complete Python programs/functions for each Q1(a) to (e) into the solution word document. Screenshot output obtained from the execution of each program, and paste them into the word document.
A single-player guessing game uses alphabets in place of digits to make a puzzle out of the addition of two single-digit numbers and the answer. The letters a to j are randomly ordered and each digit 0 to 9 are represented by corresponding letters by position. The player solves the puzzle by guessing which digits fit into the puzzle. Study the sample program output and the accompanying notes for the problem requirements. User input is shown underlined.
You got it in 5 tries
Express your understanding of modular program design. Develop a program that uses the only collection type str for any collection of values, and allows a player to play ONE (1) game to solve a puzzle.
You may use this function to map digits to letters:
from random import shuffle def getLetterMap():
stringList = list(‘abcdefghij’) shuffle(stringList)
return ”.join(stringList)
Note that only this function has a list. The rest of your program should work with str and number types only. You will incur a heavy penalty if you use other collections such as list, dictionary or sets.
The required tasks for the program are as follows:
To generate a random one-digit number.
To use the letter map to transform the digit(s) of a number/answer to letters.
To update the letters in the puzzle with guessed digits.
To get the two one-digit number random numbers and a transformation mapping.
To transform the numbers and answer for the puzzle.
To display the cheat sheet and puzzle.
To let a player guess the digits for the letters. You may assume user will enter the correct data types.
To track the number of guesses.
To display the outcome of the guess To display the updated puzzle.
To determine whether the puzzle is solved, and if so, to end the game.
Paste as text the code for Q2(a) and (b) together as a complete Python program into the word document. Screenshot output obtained from the execution of the program, and paste them into the word document.
Extend the single-player guessing game to a game for 1 to 4 players. In addition, the players can choose to play with addition puzzles using n-digit numbers where n is a number from 1 to 3
There must be at least one player!
Player Name or <ENTER> to end: anna
Player name or <ENTER> to end: anna
Anna is already is player list
Player name or <ENTER> to end: betty
Player Name or <ENTER> to an end: Charlie
Player name or <ENTER> to end: Dennis
Choose the number of digits for each number in addition (1-3): 0
Choose number of digits for each number in addition (1-3): 5
Choose number of digits for each number in addition (1-3): 2
4-player Game
The required tasks for the program are as follows:
To generate a random number of n-digit.
To replace the digits of a number with letters based on the mapping.
To update the letters in the puzzle with guessed digits.
To get the required random numbers, transformation mapping, and to set up the puzzle.
To display the cheat sheet and puzzle.
To allow players to take turns in guessing the digits for the letters.
To allocate points to players based on their guesses. The points are accumulated over games.
To display the updated puzzle.
To determine whether the puzzle is solved, and if so, to end the game.
To read the names of 1 to 4 players with no duplicate.
To read n, the number of digits where n is between 1 and 3.
To repeatedly allow players to play a game until the players choose to end.
To display the players’ name and their points, in descending order of points and ascending order of player names.
Notes:
A school uses a lab operator to provide lab facilities for its programming modules.
The lesson schedule for modules is shown in Table Q3 (a). Each programming module consists of two lessons and one proficiency test. For example, the lessons for module A are conducted on Monday and Tuesday, and a proficiency test is administered on Friday. A student can take any number of modules concurrently as there is no conflict in the module schedules
Series | Module | Lesson Days
(2 hours per lesson) |
Proficiency Test (2 hours) |
Foundational | A | Monday and Tuesday | Friday |
B | Wednesday and Thursday | Friday | |
Intermediate | C | Monday and Tuesday | Friday |
D | Wednesday and Thursday | Friday |
Table Q3 (a)
A purchase of one lab day entitles one student to use lab facilities for a whole day. The school intends to purchase lab days for students only for days when they are on campus for lessons or tests; students tend to use the lab for self-practice only on those days.
The enrolment data used by the application comes from a text file, studentEnrolment.txt. The current content of the file is shown here:
A, 127 130 123 210 109 128 204 206 111 129 103 116 112 209 122 202 121 101 113 104
B, 128 206 101 111 127 119 113 207 117 204 106 123 103 105 205 118
C, 230 208 204 201 220 209 229 218 224 216
D, 228 217 206 221 210 227 224 209 203 229 218
Each line in the file starts with a module code. A comma separates the module code from a sequence of student id of students enrolled for the module. The student ids for each module are sequenced according to the time of enrolment.
To accurately compute the number of lab days to purchase each week, the school sums up the number of students who have lessons or tests on each day, rather than the number of enrolment in each module to avoid double counting. For example, students identified by student ids 204 and 209 are enrolled in both modules A and C will need 3 lab days instead of 6 as both modules are scheduled on Monday, Tuesday, and Friday.
Apply modular programming and decide on the functions to implement the application.
Note: You are NOT allowed to use the set data type and its methods as well as the direct method from the key method. You will incur a heavy penalty if you use sets or the from key method.
At the start of the application, the text file, txt is read into a dictionary. The module code acts as the key and the value is a list to record the student id of students enrolled in the module.
Just before the application ends, the data in the dictionary should be written back to the same file, in the original order that the student ids appear in the file.
The application provides the user with the following options:
Menu
1. Add to Enrolment
2. Get Number of Days to Purchase
0. Exit
For Q3(b), the application always removes leading and trailing whitespaces in the input string for all non-numeric input.
The application keeps prompting the user until he enters a valid module code or an empty string.
Enter choice: 1
Enter module code or <ENTER> to end: f
Please enter a valid module code or <ENTER> to end
Enter module code or <ENTER> to end: w
Please enter a valid module code or <ENTER> to end
Enter choice: 1
Enter module code or <ENTER> to end:
Abandoning Add to Enrolment operation
Invalid id. Student id must be positive Enter student id: 0
Invalid id. Student id must be positive Enter student id: 1
Add to Enrolment operation has successfully completed
However, if a student is already enrolled previously, the application will not enroll the student.
Enter choice: 1
Enter module code or <ENTER> to end: c
Enter student id: 1
Add to Enrolment operation failed. The student is already enrolled in C.
Number of unique students on Monday and Tuesday = 29
Number of unique students on Wednesday and Thursday = 26
Number of unique students for Friday test = 41
Number of lab days required for the week = 151
B, 128 206 101 111 127 119 113 207 117 204 106 123 103 105 205 118
C, 230 208 204 201 220 209 229 218 224 216 1
D, 228 217 206 221 210 227 224 209 203 229 218
Note that student 1 is at the end of the list for module C, in the order of time of enrolment.
Paste the Python program as text into the word document. Screenshot output obtained from the execution of the program, and paste them into the word document.
Buy Answer of ICT 133 Assignment & Raise Your Grades
Pay & Buy Non Plagiarized AssignmentDo you need help on a ICT 133 Structured Programming Assignment? Then no need to worry! Our team of experts provides the best assignment help designed for students. We are here to assist you 24/7. We provide the Singapore Assignment Help And We will deliver your assignment before the deadline with well-researched results. We also provide free assignment samples written by PhD expert writers. Contact us now and boost your academic grades!
Let's Book Your Work with Our Expert and Get High-Quality Content