Ex. 7.2 — Basic C++ programming
You cannot submit for this problem because the homework's deadline is due.
File
Sample Makefile and CMakelists for cpp has been uploaded to canvas (under extra folder). Also, you need to use cpp template for hw7 (under extra folder)
GNUMake
If you choose GNUMake, then you should compress assignment.h
, ex1.cpp
, ex2.cpp
, ex4.cpp
, main.cpp
, Makefile
directly into a zip and submit this zip. (A sample Makefile
for hw7 is uploaded on Canvas).
If you just finished ex2 and you immediately want to test whether your ex2 is working correctly. You need to modify your main.cpp
, assignment.h
, Makefile
and then compress main.cpp
,assignment.h
,Makefile
,ex2.cpp
into a zip and submit this zip.
The sample Makefile
on Canvas has -o main
, do not change this main
!
CMake
If you choose CMake, then you should compress assignment.h
, ex1.cpp
, ex2.cpp
, ex4.cpp
, main.cpp
, CMakeLists.txt
directly into a zip and submit this zip. (A sample CMakeLists.txt
for hw7 is uploaded on Canvas).
If you just finished ex2 and you immediately want to test whether your ex2 is working correctly. You need to modify your main.cpp
, assignment.h
, CMakeLists.txt
and then compress main.cpp
,assignment.h
,CMakeLists.txt
,ex2.cpp
into a zip and submit this zip.
The sample CMakeLists.txt
on Canvas has add_executable(main ...
, do not change this main
! Also, do not change cmake_minimum_required(VERSION 2.7)
Description
Write a short C++ program which displays a menu for the user to choose between converting US dollars into Chinese RMB and Chinese RMB into US dollars. The user inputs the amount and the precision, then the program display the corresponding result.
Note: use 1.00 USD = 6.20350 CNY as the exchange rate
Format
Input
three lines, the first one being 1 for USD or 2 for CNY, the amount on the second one, and
the precision on the third one
Output
one line showing the result of the conversion
Sample 1
Input
1
100
6
Output
620.350
Limitation
1s, 32MiB for each test case.
Homework 7 (Individual)
- Status
- Finished
- Problems
- 4
- Open Since
- 2019-11-17 00:00
- DDL
- 2019-11-20 23:59
- Extension
- 72.0 hour(s)