Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default [ASK] gan sumpah ane puyeng banget, bantuin dong

ane ada assignment soalnya kaya gini gan, ada yg bisa bantu kah



Write a program that tabulates results of an opinion poll on banning smoking in public places.

The results are contained in a file name smoke.dat as below.



1 M

2 F

2 M

3 F

3 F

1 F

2 M

:

:

:

2 F

1 M



Each record consists of:

� a single opinion: 1 indicates �agreed�, 2 for �not agreed�, and 3 for �not sure�.

� gender : 'M' for male, 'F' for female



Your program should read the data into two arrays namely opinion and gender. Then count

the number of each opinion category based on gender type and also calculate the total for each opinion category, each gender type and also the overall total



Then display the results on the screen in the following format:



Opinion Male Female Total

-------------------------------------

Agreed 19 25 44

Not agreed 23 24 47

Not sure 6 5 11

-------------------------------------

Total 48 54 102



agan2 yg dewa2 mohon bantuannya







Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 05:56 AM.


no new posts