XMSS 2018 P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
2 XINMIN SS PRELIM 2018 Task 1 You are tasked to evaluate the loan packages from four banks in Singapore. All the loans are using compound interest. You are required to finish setting up the spreadsheet to show the total amount payable to each bank at the end of the loan period. Open the file LOAN. You will see the following data. Save the file as EVA_<Your name>_<Class>_<Index number> 1 Use a formula to convert the number of years in the Loan Tenure (year) column to number of months and use it to complete the Loan Tenure (month) column. The values should be displayed as number with no decimal places. [3] 2 Use an appropriate function to search for the Interest Rate per Month (x year loan) in the Rates table and use it to complete the Loan Interest Rate column. The interest rate should be displayed as percentage of two decimal places. [4] 3 Use an appropriate function to calculate the total amount of payable to the bank at the end of the loan and use it to complete the Total Amount Payable to Bank column. These values should be displayed as currency of two decimal places. [3] Save and close your file.
3 Task 2 The following program accepts three words and joined them together to form a sentence by adding a space in between them, and eventually prints out the entire sentence. num_of_words = 3 result = "" for count in range(num_of_words): word = input("Enter a word: ") result += word if count < num_of_words-1: result += " " print("Sentence =", result) Open the file JOINWORDS.py Save the file as MYWORDS_<Your name>_<Class>_<Index number> 4 Edit the program so that it: (a) Accepts only 5 words [1] (b) Prints out the total number of characters used to construct the entire sentence [1] (c) Prints out the words entered on separate lines before the sentence is printed, e.g. Word List: I love Computing Sentence = I love Computing [5] (d) Checks if the word input has a length of 1 to 15 characters, and if not, asks the user for the input again as necessary. [3] Save your program.
4 Task 3 The following program should read a denary non-negative integer from the user. The program will then convert the denary integer to its binary value and print it to the screen. The “division by 2” method is employed to carry out the conversion. There are several syntax errors and logical errors in the program. NEW_BASE == 3 num = Input("Enter a non-negative integer: " num = float(num) result = "" q = num r = q % NEW_BASE result = str(r) + result q = q // NEW_BASE while q > 0 r = q % NEW_BASE result = result + str(r) q = q / NEW_BASE print(result, "in Decimal is", num, "in Binary.") Open the file D2B.py Save the file as MYD2B_<Your name>_<Class>_<Index number> 5 Identify and correct the errors in the program so that it works correctly according to the description above. [10] Save your program. Task 4 You have been asked to write a program to simulate the Caesar Cipher
Content continues in the PDF.
Related notes
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 MSExam Papers · 2024
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices

