ISOM 3029 - Computer Programming Using C++

University of Macau
Faculty Of Business Administration
ISOM 3029 - Computer Programming Using C++
2019/2020 (First Semester)
Assignment 1
Due date: October 11, 2019 (before 5pm)
Submitted to: Ms YunYun Zhou (GA)

Instructions:
?Read the Assignment Requirements posted in the UMMoodle before attempting to solve the following problems with C++ programs.
?Both the hardcopy and softcopy of your assignment should be submitted on time. All programs (.cpp files) are to be compressed and uploaded to the UMMoodle under the “Submit Assignment 1” button. The compressed file should be named with your student number such as “ba12345_Ass1.zip”.

Question 1:
Write a C++ program that outputs a greeting message at the beginning, then reads a positive two-digit integer and returns the integer with its digits reversed. For example, if the

ISOM 3029作业代做user inputs the number 23, the program should return 32. Your program should allow the user to choose to continue or not. It will also output a message to end the program.

Sample Input & Output:

Welcome to the Reverse Program!

Please enter a positive two-digit number: 23
The reversed form of 23 is 32.
Would you like to continue (Y for Yes, N for No)? Y
++++++++++++++++++++++++++++++++++++++++++++++++++++

Please enter a positive two-digit number: 65
The reversed form of 65 is 56.
Would you like to continue (Y for Yes, N for No)? N
++++++++++++++++++++++++++++++++++++++++++++++++++++

Thank you very much!

Question 2:
Negotiating a mortgage loan by the bank is not always straightforward. Suppose you wish to borrow money from the bank to buy a house. Your mortgage loan has a face value of $100,000, the annual interest rate is 6% p.a., and the duration is not fixed. Suppose you promise to pay back by monthly instalments of $1,110 (principal plus interest) to the bank, and the remaining balance (i.e. $33.60) will be shown after the last repayment month. The interest is computed by multiplying the current face value of your loan (e.g. for the first month, multiply $100,000 by 0.06, to yield $6,000 as the annual interest for the first year and the interest for the first month will then be $500.) The repaid principal amount for the first month will then be $610 (which comes from the difference between the repayment amount $1,110 and the interest $500). This repaid principal amount $610 will be deducted from the current face value of the loan monthly, leaving your loan becoming less and less. Therefore, the current face value of your loan for the second month will be $99,390, and the interest will be $496.95 (correct to 2 decimal places), leading to a repaid principal amount of $613.05 (correct to 2 decimal places) for the second month. Repayment is made in monthly installments based on the current face value. This method of calculation is normal in mortgage loan repayment.
Write a C++ program that will take 3 inputs: the amount of your loan, the annual interest rate, and the monthly instalment amount. The program should display a table listing all the monthly installments that you have to pay the bank, until the remaining balance is less than the monthly instalment amount. It should also calculate the monthly current face value of the loan, the monthly interest payment and the repaid principal as shown below.

Sample Input & Output:

Welcome to the Mortgage System
==============================

Please enter your mortgage loan amount: 100000
Please enter the annual interest rate(%): 6
Please enter the monthly instalment amount: 1110

Month Current face value Interest Repaid Principal
==============================================================
1 $100,000.00 $500.00 $ 610.00
2 $ 99,390.00 $496.95 $ 613.05
3 $ 98,776.95 $493.88 $ 616.12
… … … … … … …
… … … … … … …
120 $ 1,137.91 $ 5.69 $1,104.31

Remaining Balance = $33.60
(Note: The remaining balance $33.60 is settled on the 120th month!)

Question 3:
A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 30 hours they work and “time-and-a-half”, i.e., 1.5 hours their hourly wage – for overtime hours worked), commission workers (who receive $200 plus 5% of their gross weekly sales), or pieceworkers (who work on only one type of item and receive a fixed amount of money per item for each of the items they produced). You are required to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of employee has its own pay code: Code 1 for Managers, Code 2 for Hourly workers, Code 3 for Commission workers and Code 4 for Pieceworkers.

Write a C++ program to compute each employee’s weekly payroll according to that employee’s pay code entered by the user, who will also input the appropriate facts for your calculation. Set a sentinel value -1 to stop the program. After processing all the employees’ data, a summary about each type of employee should be displayed as shown below.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codehelp

原文地址:https://www.cnblogs.com/codejava/p/11687504.html

时间: 2024-11-09 03:01:15

ISOM 3029 - Computer Programming Using C++的相关文章

K老在拿图灵奖时的发言:Computer Programming as an Art

很多话说得很透彻,把一些觉比较精彩的摘抄一下.... It seems to me that if the authors I studied were writing today, they would agree with the following characterization: Science is knowledge which we understand so well that we can teach it to a computer; and if we don't ful

CCN2042 Computer Programming

CCN2042 Computer ProgrammingGroup Project – Cooking Game(Due: 23:59, 18 Apr 2019 (week 12 before Easter))Expected Learning Outcomes familiarise themselves with at least one high level language programming environment. develop a structured and documen

MTH5001: Introduction to Computer Programming

projectMarch 14, 20191 MTH5001: Introduction to Computer Programming 2018/191.1 Final Report Project: "Networks"1.1.1 Instructions:First, please type your name and student number into the Markdown cell below:Name:Student number:You must write yo

CS2313 Computer Programming

CS2313 Computer ProgrammingAssignment OneDeadline: 2019-Nov-16 11:59pmLate submission: 70% (within 24hrs after the deadline), 0% (after 24hrs)1. Problem descriptionA “lucky sequence” is the sequence of numbers where every number after the first twois

Reflection (computer programming) -反射

n computer science, reflection is the ability of a computer program to examine, introspect, and modify its own structure and behavior at runtime.[1] A language supporting reflection provides a number of features available at runtime that would otherw

Teach Yourself Programming in Ten Years

Teach Yourself Programming in Ten Years Peter Norvig Why is everyone in such a rush? Walk into any bookstore, and you'll see how to Teach Yourself Java in 24 Hours alongside endless variations offering to teach C, SQL, Ruby, Algorithms, and so on in

Important Programming Concepts (Even on Embedded Systems) Part V: State Machines

Earlier articles in this series: Part I: Idempotence Part II: Immutability Part III: Volatility Part IV: Singletons Oh, hell, this article just had to be about state machines, didn’t it? State machines! Those damned little circles and arrows and q’s.

glob (programming) and spool (/var/spool)

http://en.wikipedia.org/wiki/Glob_(programming) In computer programming, in particular in a Unix-like environment, the term globbing is sometimes used to refer to pattern matching based on wildcard characters.[citation needed] The noun "glob" is

10 ways to improve your programming skills

http://rudyn.is-programmer.com/ 1. Learn a newprogramming language学习一门新的编程语言 Learning new programming languages will expose you to new ways ofthinking; especially if the new language uses a paradigm which you aren't yetfamiliar with. Many of the ways