assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( cj...

5

Upload: others

Post on 10-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( CJ (47i12J Z2J return ( Four user-åeñnecl (471121 PLE gets function PLE to 'z Shouijcl
Page 2: Assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( CJ (47i12J Z2J return ( Four user-åeñnecl (471121 PLE gets function PLE to 'z Shouijcl

Assignment 2

2

Page 3: Assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( CJ (47i12J Z2J return ( Four user-åeñnecl (471121 PLE gets function PLE to 'z Shouijcl

Assignment 2

3

#include <iostream>using namespace std;

Int plus(int, int);Int minus(int, int);void multi(int, int, int&);Void division(int, int, float&);

void main(){

}

Variables declaration

Getting user inputs

Call four functions

Print results

Define the four functions

Page 4: Assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( CJ (47i12J Z2J return ( Four user-åeñnecl (471121 PLE gets function PLE to 'z Shouijcl

Assignment 2

4

Page 5: Assignment 2 - khu.ac.krhaptics.khu.ac.kr/pb/assignment2.pdf · 2014-08-11 · function ( CJ (47i12J Z2J return ( Four user-åeñnecl (471121 PLE gets function PLE to 'z Shouijcl

Assignment 2

5

#include <iostream>using namespace std;

int Cal_year_day(int, int);int Cal_month_day(int, int);int Cal_day(int, int);

void main(){

}

int today_year = 2014;int today_month = 4;int today_day = 5;

int year, month, day; //for input int diff_year_day, diff_month_day, diff_day; //for saving return values

Call three functions

Calculate the sum of return values and print

Definitions of the three functions