MIS 740: Software Concepts Fall 2019 Individual Assignment 2 Due Date: 5:29 PM, September 26, 2019 (Submit via WebCampus). Weight: 5% of the total grades Purpose:  Practice the decision structures. ...

MIS 740: Software Concepts Fall 2019

Individual Assignment 2


Due Date: 5:29 PM, September 26, 2019 (Submit via WebCampus). Weight: 5% of the total grades


Purpose:  Practice the decision structures.   Practice the repetition structures (i.e., while or for statements).  Use decision and repetition structure for input validation and limit user input.  Practice the design of functions, including passing variables and returning value.


1. Income Text Calculator (35%): Write a program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount:     10% on taxable income from $0 to $9,525, plus     12% on taxable income over $9,526 to $38,700, plus     22% on taxable income over $38,701 to $82,500, plus     24% on taxable income over $82,501 to $157,500, plus     32% on taxable income over $157,501 to $200,000, plus     35% on taxable income over $200,001 to $500,000, plus     37% on taxable income over $500,001 or more


The program should display the total tax due to the user. The program should show an error message if the user enters a negative number.


Grading criteria: Correctness:   The code can be compiled without any syntax error.  The code can generate the requested results.  The program is properly documented using comments, including the header (i.e., the purpose of the program, author name, and date) and in-code comments. Technique used:   Use variables in the program and follow the naming conventions discussed in class.   Use if…else condition properly to check user input and calculate the result.  Format the result properly with thousands separator and two digits after the decimal point.


Page 2 of 3


2. City Population (30%): City of Wonderland needs an application to predict the population of the city for a specified number of years and growth rate. The application should allow the user to enter the current population (in millions), current growth rate (in percentage), and the number of years to predict. The program should then display each year (starting from current year) and the projected population. The numbers in the result should be aligned properly.


The program should check whether the population and the number of years to predict are positive numbers. The growth rate should be between -1 and 1.


Grading criteria: Correctness:   The code can be compiled without any syntax error.  The code can generate the requested results, including the correct logic, format, and text alignment.   The program is properly documented using comments, including the header (i.e., the purpose of the program, author name, and date) and in-code comments. Technique used:   Use variables in the program and follow the naming conventions discussed in class.   Use repetition statements (i.e., while or for loop) in the program to generate the correct result.  Use if…else condition properly to check user input and show proper messages to the user.  Format the result properly.


Page 3 of 3


3. Fine for Overdue Books (35 points): Please create a program for a library. The program asks the user to enter the number of books checked out and the number of days they are overdue. Pass those values to a function that calculates the fine, which is 10 cents per book per day for the first seven days a book is overdue, then 20cetns per book per day for each additional day. The fine is shown in dollars.


If the user enters zero or a negative number, the program should show an error message and request input again.


Grading criteria: Correctness:   The code can be compiled without any syntax error.   The code can generate the requested results.   The program is properly documented using comments, including the header (i.e., the purpose of the program, author name, and date) and in-code comments. Technique used:   Function(s) are created to calculate and return the fine amount. Follow the naming conventions discussed in class.  Getting user input is done, including proper input validation  Displaying the result with the proper format.


May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here