SlideShare une entreprise Scribd logo
1  sur  1
FUNCTION BY VALUE
A stationary Company sells four types of items and each item price is shown in following table:-
Item Code Price per Quantity
1031 RM 1.23
3031 RM 2.34
2111 RM 6.78
3455 RM 8.75
a. Write a function definition to calculate the price for an item and display the result. This function
will receive two parameters which are item code and quantity for the item. The function
prototype for this function is declared as follows:-
void Price ( int, int);
b. If this function Price is declared as follows
float Price ( );
write the function definition whereby the data of an item code and quantity will be input this
function, then this function will calculate the price and return the result to the main.

Contenu connexe

Tendances

ISOQUANTS OR EQUAL PRODUCT CURVES
ISOQUANTS OR EQUAL PRODUCT CURVESISOQUANTS OR EQUAL PRODUCT CURVES
ISOQUANTS OR EQUAL PRODUCT CURVESniraj joshi
 
Isoquants and its properties
Isoquants and its propertiesIsoquants and its properties
Isoquants and its propertiesAwesh Bhornya
 
Isoquants ppt
Isoquants pptIsoquants ppt
Isoquants pptSowmiya S
 
B3 perilaku biaya
B3 perilaku biayaB3 perilaku biaya
B3 perilaku biayakoranbekas
 
Python operators part2
Python operators part2Python operators part2
Python operators part2Vishal Dutt
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAminaRepo
 
simba nyakdee nyakudanga presentation on isoquants
simba nyakdee nyakudanga presentation on isoquantssimba nyakdee nyakudanga presentation on isoquants
simba nyakdee nyakudanga presentation on isoquantsSimba Nyakudanga
 
Cost & man chapter 2 solutions 2008
Cost & man chapter 2 solutions 2008Cost & man chapter 2 solutions 2008
Cost & man chapter 2 solutions 2008Kwanda Matiwane
 
COST ACCOUNTING ACCT 301 ASSIGNMENT 2
COST ACCOUNTING ACCT 301 ASSIGNMENT 2COST ACCOUNTING ACCT 301 ASSIGNMENT 2
COST ACCOUNTING ACCT 301 ASSIGNMENT 2Voffelarin
 
Handout 2 ma problem 6
Handout 2 ma problem 6Handout 2 ma problem 6
Handout 2 ma problem 6azmatmengal
 
Binary operator overloading
Binary operator overloadingBinary operator overloading
Binary operator overloadingBalajiGovindan5
 
Sorting two numbers
Sorting two numbersSorting two numbers
Sorting two numbersdevil00dante
 

Tendances (19)

ISOQUANTS OR EQUAL PRODUCT CURVES
ISOQUANTS OR EQUAL PRODUCT CURVESISOQUANTS OR EQUAL PRODUCT CURVES
ISOQUANTS OR EQUAL PRODUCT CURVES
 
EEFA - ISOQUANT - FINAL YEAR CS/IT - SRI SAIRAM INSTITUTE OF TECHNOLOGY - DR...
EEFA - ISOQUANT  - FINAL YEAR CS/IT - SRI SAIRAM INSTITUTE OF TECHNOLOGY - DR...EEFA - ISOQUANT  - FINAL YEAR CS/IT - SRI SAIRAM INSTITUTE OF TECHNOLOGY - DR...
EEFA - ISOQUANT - FINAL YEAR CS/IT - SRI SAIRAM INSTITUTE OF TECHNOLOGY - DR...
 
Isoquant and isocost
Isoquant and isocostIsoquant and isocost
Isoquant and isocost
 
Isoquants and its properties
Isoquants and its propertiesIsoquants and its properties
Isoquants and its properties
 
Isoquants ppt
Isoquants pptIsoquants ppt
Isoquants ppt
 
B3 perilaku biaya
B3 perilaku biayaB3 perilaku biaya
B3 perilaku biaya
 
Functions in php
Functions in phpFunctions in php
Functions in php
 
Python operators part2
Python operators part2Python operators part2
Python operators part2
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
 
simba nyakdee nyakudanga presentation on isoquants
simba nyakdee nyakudanga presentation on isoquantssimba nyakdee nyakudanga presentation on isoquants
simba nyakdee nyakudanga presentation on isoquants
 
Cost & man chapter 2 solutions 2008
Cost & man chapter 2 solutions 2008Cost & man chapter 2 solutions 2008
Cost & man chapter 2 solutions 2008
 
Report on c
Report on cReport on c
Report on c
 
COST ACCOUNTING ACCT 301 ASSIGNMENT 2
COST ACCOUNTING ACCT 301 ASSIGNMENT 2COST ACCOUNTING ACCT 301 ASSIGNMENT 2
COST ACCOUNTING ACCT 301 ASSIGNMENT 2
 
Handout 2 ma problem 6
Handout 2 ma problem 6Handout 2 ma problem 6
Handout 2 ma problem 6
 
Equal product curves
Equal product curvesEqual product curves
Equal product curves
 
Binary operator overloading
Binary operator overloadingBinary operator overloading
Binary operator overloading
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
05 operators
05   operators05   operators
05 operators
 
Sorting two numbers
Sorting two numbersSorting two numbers
Sorting two numbers
 

En vedette (9)

Latihan 2
Latihan 2Latihan 2
Latihan 2
 
Looping
LoopingLooping
Looping
 
Fail
FailFail
Fail
 
Basic pengaturcaraan
Basic pengaturcaraanBasic pengaturcaraan
Basic pengaturcaraan
 
Fungsi (i)
Fungsi (i)Fungsi (i)
Fungsi (i)
 
Pengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstrukturPengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstruktur
 
Presentation2
Presentation2Presentation2
Presentation2
 
Penyelesaian masalah
Penyelesaian masalahPenyelesaian masalah
Penyelesaian masalah
 
Pengaturcaraan asas
Pengaturcaraan asasPengaturcaraan asas
Pengaturcaraan asas
 

Fungsi (ii)

  • 1. FUNCTION BY VALUE A stationary Company sells four types of items and each item price is shown in following table:- Item Code Price per Quantity 1031 RM 1.23 3031 RM 2.34 2111 RM 6.78 3455 RM 8.75 a. Write a function definition to calculate the price for an item and display the result. This function will receive two parameters which are item code and quantity for the item. The function prototype for this function is declared as follows:- void Price ( int, int); b. If this function Price is declared as follows float Price ( ); write the function definition whereby the data of an item code and quantity will be input this function, then this function will calculate the price and return the result to the main.