ICT131: Singapore Citizens- Command Line- Java Programming Assignment

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

Internal Code: TV48
Java Programming Assignment:
Task:
The objectives of this question are
(a) to declare variables
(b) to write simple Java program without selection and repetition structures
(c) to write Java program with selection structure
(a) Note: You are NOT allowed to use selection or repetition structure for Question 1(a). Write a program that accepts one 3-digit and one 1-digit whole numbers from the command line, and output the working of the division of the 3-digit number (dividend) by the 1-digit number (divisor), showing the carry, the quotient and the remainder.
The program should output the carry digit on the first line, the divisor and dividend on the second line, and the quotient and remainder on the last line. For example, if the two numbers are 158 and 7, the program should output:
1 1
7) 1 5 8
———-
0 2 2 R4
If the two numbers are 447 and 3, then the program should output:
1 2
3) 4 4 7
————
1 4 9 R0
Note that you should not hardcode the values of the integers to be divided in your program. Instead, your program must read the values from the command line. Submit your program listing together with screenshots showing THREE runs of your program with the sample inputs (“158” , “7”) , (“447” , “3”) on the command line and another pair of your own choice. Include your name and student number in the output.
(b) To determine the amount of subsidy for a doctor visit for common illnesses, refer to Table 1 from the webpage https://www.chas.sg/content.aspx?id=636, reproduced here.
programming
The subsidies for doctor visit for common illnesses applicable to only 3 categories of Singapore citizens with and without income are listed here:
1. Pioneer citizens (born on or before 31 December 1949 and who is a Singapore citizen before 1 Jan 1987) receives up to $28.50 per doctor visit.
2. For non-pioneer citizens with household income up to $1100 per person receives up to $18.50 per doctor visit,
3. For non-pioneer citizens without income and living in residence with annual value up to $13000 receives up to $18.50 per doctor visit.
Singapore citizens not under these categories do not qualify for any subsidy for doctor
visit for common illnesses. Outline the control structures of structured programming to write a program that
(i) prompts and reads
A. the bill amount,
B. the birth year of the citizen,
C. the year citizenship is obtained only if the user enters 1949 or earlier for the birth year,
D. whether the citizen has an income only if the citizen is not from the pioneer generation,
E. either the monthly income or the annual value of the residence only if the citizen is not from the pioneer generation.
(ii) uses table 1 to determine and display the amount subsidy. If no subsidy is applicable, it prints a message to state that the citizen does not qualify for subsidy.
(iii) computes the amount payable. The amount payable cannot be negative.
Without using arrays or regular expressions, write a Java program to implement the game MasterMindTM using only strings, characters and integers. Use the Scanner class to read user input and the Math class to generate random number. For the game, you must adhere to the following constraints:
1. Your program makes 4 random choices to pick 4 different colours from 6 colours (stored as a string “RGBYOP”). The letters represent the 6 distinct colours: Red, Green, Blue, Yellow, Orange and Purple. The random choices are stored as a single string e.g., “YBRP”.
2. The player’s guess is read as a string and consists of 4 different letters for 4 different colours e.g., “BORY”. Each correct colour guessed in the right position earns a black pin (B) and each correct colour guessed in a wrong position earns a white pin (W). In this example, the guess earns 2 white pins and 1 black pin, and the program displays
WWB.
2. The player wins if he is able to guess the 4 correct colours in the correct positions within 8 attempts.
A. The player is allowed to quit a game at any time by entering q when prompted for a guess.
B. At the end of a game, the program prompts the player whether he wants to play a new game. The user should enter q if he wishes to exit the program.
C. Outline the control structures of structured programming and use ALL three repetition structures: for, while and do-while..
Submit your program listing together with screenshot showing two runs of your program output.

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services