Top Banner
8

Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Aug 12, 2018

Download

Documents

phamcong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and
Page 2: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

2

Page 3: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

3

Page 4: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

4

Correct results for each line

Page 5: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

5

Page 6: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

6

Output result

Your input: 1234 Reversed output: 4321

Page 7: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

7

Your measurement in inch: 2 2 inch = 0.1666 foot 5.0761 centimeter 0.0555 yard 0.0508 meter

(note the precision for floating points)

Page 8: Practice 2. Expressions, Operators, and Statementscvlab.khu.ac.kr/practice02.pdf · Practice 2. Expressions, Operators, and Statements 4 ... Practice 2. Expressions, Operators, and

Practice 2. Expressions, Operators, and Statements

8

How many apples did you buy: 2

How many bananas did you buy: 2

How many peaches did you buy: 3

How many grapes did you buy: 1

How many melons did you buy: 4

Price for apple: 2 * 5000 = 10000

Price for banana: 2 * 1500 = 3000

Price for peach: 3 * 3500 = 10500

Price for grape: 1 * 6000 = 6000

Price for melon: 4 * 1200 = 4800

Total price of your purchase: 34300