SlideShare a Scribd company logo
1 of 2
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
          FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING
          BTI 10202: COMPUTER PROGRAMMING



                                                 TEST 1
 NAME : _____________________________________                                           MARKS
 MATRICS NO.: _______________ DATE : ________



Write a program to calculate cost of installing tiles in a room. Calculation should be in Meter Square (m2).


The user may choose from two different tile sizes:

                                    20 cm x 20                20 cm x 10
                                        cm                        cm

                                     RM3.00




The output should be similar to:




Please save your file on desktop as <matrixcard>_<yourname>.c
Answer:
 #include<stdio.h>
 #include<conio.h>

 main(){

     float lb, wb,roomsize=0,ttile=0,cost=0,unit;    3m
     int tile;


    reenter:
    printf("nt***Tile Calculator(Metric) And Invoice generator***nn1. 20cm x 20cmn2. 20cm x
 10cmnPlease choose your tile size: ");
    scanf("%d",&tile);
                                            2m
    if(tile!=1 && tile!=2) {goto reenter;}

     printf("nPlease enter room length(m): ");     I/p 1m
     scanf("%f",&lb);
     printf("nPlease enter room width(m): ");
     scanf("%f",&wb);

     roomsize=lb*wb;         1m
     switch(tile){

           case 1:
                unit=3.0;
                ttile=roomsize/4;
                cost=ttile*unit;break;
           case 2:                         2m
               unit=2.0;
                ttile=roomsize/2 ;
                cost=ttile*unit;break;
               }




     printf("nnttt****INVOICE****n");

     printf("nProduct No.tRoom SizetNo.Tile tCost/tiletTotal");                      O/p1m
     printf("n-----------------------------------------------------------------------");
     printf("nt%dt%7.2ftt%6.1fttRM%6.2ftRM%6.2f",tile,roomsize,ttile,unit,cost);

                                                          Run w/o error 3m
                                                          2m??
     getch();

     }

More Related Content

What's hot

Tmux cheatsheet
Tmux cheatsheetTmux cheatsheet
Tmux cheatsheet
Ian Yang
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
jwjablonski
 
Tmux quick-reference
Tmux quick-referenceTmux quick-reference
Tmux quick-reference
Ramesh Kumar
 
Program to illustrate Switch, Goto and Exit statements.
Program to illustrate Switch, Goto and  Exit statements.Program to illustrate Switch, Goto and  Exit statements.
Program to illustrate Switch, Goto and Exit statements.
harman kaur
 

What's hot (19)

Linked list int_data_fdata
Linked list int_data_fdataLinked list int_data_fdata
Linked list int_data_fdata
 
week-5x
week-5xweek-5x
week-5x
 
Vim
VimVim
Vim
 
Tmux cheatsheet
Tmux cheatsheetTmux cheatsheet
Tmux cheatsheet
 
Mauro yaguachi
Mauro yaguachiMauro yaguachi
Mauro yaguachi
 
Wcbpijwbpij new
Wcbpijwbpij newWcbpijwbpij new
Wcbpijwbpij new
 
ClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browserClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browser
 
BizTalk Server Tips & Tricks for Developers and Admins (Deep Dive)
BizTalk Server Tips & Tricks for Developers and Admins (Deep Dive)BizTalk Server Tips & Tricks for Developers and Admins (Deep Dive)
BizTalk Server Tips & Tricks for Developers and Admins (Deep Dive)
 
SATySFiのこれからの課題たち
SATySFiのこれからの課題たちSATySFiのこれからの課題たち
SATySFiのこれからの課題たち
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
Elf文件解析
Elf文件解析Elf文件解析
Elf文件解析
 
Tmux quick-reference
Tmux quick-referenceTmux quick-reference
Tmux quick-reference
 
Currying in Swift
Currying in SwiftCurrying in Swift
Currying in Swift
 
Perimeter
PerimeterPerimeter
Perimeter
 
R programming lab 1 - jupyter notebook
R programming lab   1 - jupyter notebookR programming lab   1 - jupyter notebook
R programming lab 1 - jupyter notebook
 
Vim cheat-sheet-en
Vim cheat-sheet-enVim cheat-sheet-en
Vim cheat-sheet-en
 
vbscript-reference book
vbscript-reference bookvbscript-reference book
vbscript-reference book
 
Program to illustrate Switch, Goto and Exit statements.
Program to illustrate Switch, Goto and  Exit statements.Program to illustrate Switch, Goto and  Exit statements.
Program to illustrate Switch, Goto and Exit statements.
 
MFC Check
MFC CheckMFC Check
MFC Check
 

Viewers also liked

Lab exe 2 dti 2143
Lab exe 2 dti 2143Lab exe 2 dti 2143
Lab exe 2 dti 2143
alish sha
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13
alish sha
 
Purpose elaborate
Purpose elaboratePurpose elaborate
Purpose elaborate
alish sha
 
Bti1022 group assignment
Bti1022 group assignmentBti1022 group assignment
Bti1022 group assignment
alish sha
 
Final project
Final projectFinal project
Final project
alish sha
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
alish sha
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012
alish sha
 

Viewers also liked (9)

Lab 6
Lab 6Lab 6
Lab 6
 
Lab exe 2 dti 2143
Lab exe 2 dti 2143Lab exe 2 dti 2143
Lab exe 2 dti 2143
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13
 
Purpose elaborate
Purpose elaboratePurpose elaborate
Purpose elaborate
 
Bti1022 group assignment
Bti1022 group assignmentBti1022 group assignment
Bti1022 group assignment
 
Final project
Final projectFinal project
Final project
 
Lab sheet 1
Lab sheet 1Lab sheet 1
Lab sheet 1
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012
 

Similar to Test 1 alish schema 1

#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx
mayank272369
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
josies1
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
AAKASH KUMAR
 
Router Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsRouter Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditions
Morteza Mahdilar
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdfg++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
arakalamkah11
 
Modify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdfModify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdf
aaseletronics2013
 

Similar to Test 1 alish schema 1 (20)

#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
Manufacturing Cost (2.008x Lecture Slides)
Manufacturing Cost (2.008x Lecture Slides)Manufacturing Cost (2.008x Lecture Slides)
Manufacturing Cost (2.008x Lecture Slides)
 
12
1212
12
 
Functions
FunctionsFunctions
Functions
 
week-3x
week-3xweek-3x
week-3x
 
C++ TUTORIAL 5
C++ TUTORIAL 5C++ TUTORIAL 5
C++ TUTORIAL 5
 
Router Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsRouter Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditions
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
 
2 d matrices
2 d matrices2 d matrices
2 d matrices
 
C Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory managementC Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory management
 
oop Lecture 4
oop Lecture 4oop Lecture 4
oop Lecture 4
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Write a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdfWrite a C program that uses a recursive function to print a triangle .pdf
Write a C program that uses a recursive function to print a triangle .pdf
 
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdfg++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
 
Modify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdfModify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdf
 
Inc decsourcefile
Inc decsourcefileInc decsourcefile
Inc decsourcefile
 
Oop assignment 02
Oop assignment 02Oop assignment 02
Oop assignment 02
 

More from alish sha

It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifah
alish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
alish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
alish sha
 
Final project
Final projectFinal project
Final project
alish sha
 
Attn list test
Attn list testAttn list test
Attn list test
alish sha
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303
alish sha
 
Final project
Final projectFinal project
Final project
alish sha
 
Final project
Final projectFinal project
Final project
alish sha
 
Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8
alish sha
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
alish sha
 
Math hquickissential
Math hquickissentialMath hquickissential
Math hquickissential
alish sha
 
Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5
alish sha
 
Dam31303 lab sheet 4
Dam31303 lab sheet 4Dam31303 lab sheet 4
Dam31303 lab sheet 4
alish sha
 

More from alish sha (20)

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifah
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifah
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)
 
Lab 6 sem ii_11_12
Lab 6 sem ii_11_12Lab 6 sem ii_11_12
Lab 6 sem ii_11_12
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Final project
Final projectFinal project
Final project
 
Attn list test
Attn list testAttn list test
Attn list test
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303
 
Final project
Final projectFinal project
Final project
 
Final project
Final projectFinal project
Final project
 
Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
 
Math hquickissential
Math hquickissentialMath hquickissential
Math hquickissential
 
Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5
 
Rpp
RppRpp
Rpp
 
Dam31303 lab sheet 4
Dam31303 lab sheet 4Dam31303 lab sheet 4
Dam31303 lab sheet 4
 

Recently uploaded

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
lizamodels9
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
lizamodels9
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Matteo Carbone
 

Recently uploaded (20)

👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 

Test 1 alish schema 1

  • 1. UNIVERSITI TUN HUSSEIN ONN MALAYSIA FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING BTI 10202: COMPUTER PROGRAMMING TEST 1 NAME : _____________________________________ MARKS MATRICS NO.: _______________ DATE : ________ Write a program to calculate cost of installing tiles in a room. Calculation should be in Meter Square (m2). The user may choose from two different tile sizes: 20 cm x 20 20 cm x 10 cm cm RM3.00 The output should be similar to: Please save your file on desktop as <matrixcard>_<yourname>.c
  • 2. Answer: #include<stdio.h> #include<conio.h> main(){ float lb, wb,roomsize=0,ttile=0,cost=0,unit; 3m int tile; reenter: printf("nt***Tile Calculator(Metric) And Invoice generator***nn1. 20cm x 20cmn2. 20cm x 10cmnPlease choose your tile size: "); scanf("%d",&tile); 2m if(tile!=1 && tile!=2) {goto reenter;} printf("nPlease enter room length(m): "); I/p 1m scanf("%f",&lb); printf("nPlease enter room width(m): "); scanf("%f",&wb); roomsize=lb*wb; 1m switch(tile){ case 1: unit=3.0; ttile=roomsize/4; cost=ttile*unit;break; case 2: 2m unit=2.0; ttile=roomsize/2 ; cost=ttile*unit;break; } printf("nnttt****INVOICE****n"); printf("nProduct No.tRoom SizetNo.Tile tCost/tiletTotal"); O/p1m printf("n-----------------------------------------------------------------------"); printf("nt%dt%7.2ftt%6.1fttRM%6.2ftRM%6.2f",tile,roomsize,ttile,unit,cost); Run w/o error 3m 2m?? getch(); }