SPIES BERDAFTAR

Showing posts with label c-file. Show all posts
Showing posts with label c-file. Show all posts

05 August 2015

c programming source code sharing #7 : TENNIS SCOREKEEPER

ASSALAMMUALAIKUM W.B.T. peeps !

heyya guys! i've promised wayyyy loooong before that i'll be sharing my computing II assignment source code soon. lol. pardon me. just, being a potato.....is so much 'fun'. *troll face*

so, without further adieu. this is it, TENNIS SCOREKEEPER.


CLICK THE IMAGE TO ENLARGE


the algorithm of the program :
1)Start.
2)Enter team's name or default.
3)Enter number of sets to be played.
4)Enter number of game per set to be played.
5)Enter the score. (Deuce, Tiebreaker are available if applicable).
6)Display the score.
7)Decide the winner.
8)End.

the source code is kinda loooong, so i just put some screenshots of it. for the full source code;
CLICK HERE

bye!
regards,

10 February 2015

c programming source code sharing #6 : Printing a hollow square using nested for

ASSALAMMUALAIKUM W.B.T. peeps !

hi hi hi. (greeting ni, "hai hai hai" bukan gelak hi hi hi)
so today i would like to share the next source code, of my homework this week, freshly from oven!
*baru siap buat daa*

sample question:
Read an integer(entered by user) and prints a hollow square. the number of '=' used to draw line of each sides of square.

example, user enter 5, so the output is
=====
=      =
=      =
=      =
=====
a 5x5 square with a hollow.(hollow-lubang)
(not-so-square looking here, but in .exe file you'll see it is more like a square!)

another sample output:


of course, it will only works with positive integers.
& for integer=1 & 2, you'll not see a hollow.

soooo here's the screenshot of my source code:

CLICK IMAGE TO ENLARGE

or, download the c-file here. (can edit&try compile yourself!)

my lecturer told us, usually for this kind of question, there would be more than 1 solution. so my fellas out there, if you have a simpler & more unique way, please share! sharing is caring yow! & for any questions, please, just ask me ok? :)

regards,

27 January 2015

c programming source code sharing #5 : Buying Ticket/Booking Hotel using switch

ASSALAMMUALAIKUM W.B.T. peeps !

question example:

Ticket Type             Code         Price
Bed Class                   D             65
Standard Class           E              40
Economy Class           S              29

Ask user to input ticket type's code & number of seats they want to buy.
Display total price including 6% government tax.

snapshot of source code :
CLICK THE IMAGE FOR LARGER VIEW

CLICK HERE FOR THE C FILE (can copy&paste and try to compile on your own compiler&edit)

regards,

c programming source code sharing #4 : Buying Ticket/Booking Hotel using if...else

ASSALAMMUALAIKUM W.B.T. peeps !

question example:

Room Type        Code         Price
Deluxe                  D             220
Exclusive              E             170
Single                   S              130

Ask user to input room's code & number of days they are staying.
Display total price including 6% government tax.

snapshot of source code :
CLICK THE IMAGE FOR LARGER VIEW

CLICK HERE FOR THE C FILE (can copy&paste and try to compile on your own compiler&edit)

regards,

c programming source code sharing #3 : Summon Rate

ASSALAMMUALAIKUM W.B.T. peeps !

so.. hi! sorry for not updating last week as i got no homework. :3 as repayment, today more source codes are coming! and as for the first 1 here is Summon Rate.

example of question :

(USE NESTED IF....ELSE)

Summon Rate
1.Summon within 1 month
2.Summon within 2 months and above

If user enter 1;
1.ask input for the value of summon
2.ask whether summon is within 15 days or not
   a)if yes, 50% discount will be given. display discounted value & the new summon value
   b)if no, 25% discount will be given. display discounted value & the new summon value

If user enter 2;
1.ask input for the value of summon
2.15% discount will be given. display discounted value & the new summon value

DISPLAY ERROR MESSAGE IF USER ENTER OTHER THAN 1 & 2.

so here is the snapshot of the source code.

CLICK THE IMAGE FOR LARGER VIEW


CLICK HERE FOR THE C FILE (can copy&paste and try to compile on your own compiler&edit)




regards,

15 January 2015

c programming source code sharing #2 : area of circle/disk/rim with hole calculator

ASSALAMMUALAIKUM W.B.T. peeps !
& good day

the title itself already describe the source code i'm gonna to share today. it is basically a a program which will calculate the area of circle/disk/rim with circular hole. the user need to input the outer diameter & inner diameter of the circle.

CLICK THE PICTURE TO ENLARGE

with a little bit of twist, you can change for the user to enter radius or perhaps both based on how the user wanted! this is just the simple version ;)

CLICK HERE FOR THE C-FILE (can copy&paste directly)
                                                                    regards,

c programming source code sharing #1 : change money calculator

ASSALAMMUALAIKUM W.B.T. peeps !
& good day.


this is my first entry on sharing my source code i've worked on. from now onwards i will basically share my source codes here which are actually my homework that i will be getting every weeks this semester.

do feel free to comments & ask anything. :)

example question:

              Write a program that takes as input any change expressed in cents. It should then compute the number of 50-ringgit, 10-ringgit, 5-ringgit, 1-ringgit, 50-cent, 20-cent, and 10-cent, in that order. For example, 3020 cents should be returned as one 20-ringgit, one 10-ringgit and one 20-cent.



CLICK THE IMAGE FOR LARGER VIEW


view the c-file here (can copy-paste)


                                                                    regards,