Your SlideShare is downloading. ×
FUNCTION BY VALUE
A stationary Company sells four types of items and each item price is shown in following table:-
Item Co...
Upcoming SlideShare
Loading in...5
×

Fungsi (ii)

29

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
29
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Fungsi (ii)"

  1. 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.

×