SPIES BERDAFTAR

Showing posts with label assignments. Show all posts
Showing posts with label assignments. Show all posts

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,

02 February 2015

my group project assignment

ASSALAMMUALAIKUM W.B.T. peeps !

hi. just wanna tell you guys i'm doing sports score keeper (yep, with 's' coz more than 1 sport). for my Foundation in Computing II subject group project assignment. there'll will be basketball, futsal, netball & so on if Allah wills. Currently when i'm writing this i only finished Basketball Score Keeper & working on Futsal one. (stuck at penalty shootout part,duh.). Please pray for my group k. Adios!


regards,

28 January 2015

when..

ASSALAMMUALAIKUM W.B.T. peeps !

pabila lebih utamakan kerja yg due 2 MAC berbanding ESOK kerana minat..
watever. janji dah siap assignment. alhamdulillah. :3




korang dah siap assignment csc? 

***update---assignmentku direject, kena tunggu dah blajo chapter function dlu ghupanya...huhu


regards,

27 January 2015

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 #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,