Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hello, I have a report and by using these code I want to write the assumption and limitations for this program and these last two

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedhello, I have a report and by using these code I want to write the assumption and limitations for this program image text in transcribedimage text in transcribedand these last two photo us an example for what I want for anther program

halog, welcome to our program $this is team 1 the fussian flets start... main EFcases=0; while 1 choose=input('please choose the categories:'); switch choose case 1 clothes; Estathing= EEcases + clothing: case 2 food: effood=EFcase3+foods; case 3 packaging; efrackaging=EEcases. + Sirackaging; case 4 transportation: eftransportation= EFcases +CFtransport; case 0 break otherwise displ'please enter again!!') end end L (Ctrl) - $ you will get the total carbon footprint tasat.sardan= e Estething + estend + efrackaging teisransportationi Eprintf(" total carbon footprint is $d in kg ', total carbon) time to choose the she type of material of clothes that disp('hallo... its you use) ef5=37: ef6=8 ef7-19: ef8=7 Sask user to enter the type of material of clothes fprintf("the type of material of clothes: ') fprintf( 1. nylon 'hi Erringel' 2. cotton ' Eprintfl' 3. peixaterini Ebbinsel' 4. woolin' clothing=input('please enter the name of the material of clothesis'); switch clothing case 'nylon. ef5-37: weight=input('please input the weight of the material of clothes in kg); clothing, e5*weight; case cotton ef6=8! weight=input('please input the weight of the material of clothes in kg'); clothing= ef6"weight; case 'polyster' ef7=19: weight=input('please input the weight of the material of clothes in kg); clothing e7*weight; case wool ef8-7; weight=input('please input the weight of in kg"); clothing- e8*weight: the material of clothes otherwise disp('typo!! please enter again!!') end Erkins64'the carbon emission of your product is: $d Dewedsthing) displ ........ Thank You...... displ - please be a wise consumer: Font G Paragraph Styles 27 Editing wwwwwwwww WWWWWWWWWWWWW Seffood & haloo, welcome to our program $this is team 1 the fussions flets start... $ please read xlsx file the types of food= Leadtable ('Food.xlsx'); disp. (thetypesoffood) ef=table2array (thetypesoffood (:,2)); product=input('please enter the product number:'); weight=input('please enter how much mass you bought:'); foods=ef (product) *weight; fprintf('this is the carbon emissions in your food : $d ', foods) disp(' .....lets continue to the next categories.....') wwwwwwwwwww disp('hallo... its time to choose the packaging you use') ef1=750; ef2=2690; ef3=3640; ef4=3470; Sask user to enter the type of packaging fprintf('the types of the packaging: ') fprintf(' 1. glass '); fprintfl' 2. PP (film/bags) '); fprintfl' 3. PP rigid (boxes/crates) '); fprintf('4. other plastics '); cfpackaging=input('please enter the name of packaging that you use most commonly); switch cfpackaging case 'glass! weight=input('please input weight of package in kg'); cfpackaging= ef1*weight; case 'PP (film/bags) weight=input('please input weight of package in kg'); cfpackaging= ef2*weight; case 'PP rigid (boxes/crates) weight=input('please input weight of package in kg'); cfpackaging= ef3*weight; case 'other plastics' weight=input('please input weight of package in kg'); cfpackaging= ef4*weight; otherwise disp('typo!! please enter again!!') end fprintf('the carbon emission of your product is: %d ', cfpackaging) disp(' .... Thank You..... disp(' .....please be a wise consumer:) .) disp('hallo... its time to input distance and fuel economy that you use') distance = input ('please input your distance in km:'); fueleconomy = input('Input your fuel economy in km/L:'); vol = distance/fueleconomy; fprintf('Amount of fuel consumed: $d Liter', vol) $ask user to enter the type of fuel fueltype = input ('Input your fuel type, 1: Gasoline/Patrol 2:Diesel 3. Aviation Gasoline 4.Jet Fuel:'); switch fueltype case 1 CFtransport = vol *2.032; case 2 CFtransport = vol *2.641; case 3 CFtransport = vol *2.212; case 4 CFtransport = vol +2.522; end fprintf ("Carbon footprint of your trip was: $d KgCo2 ',CFtransport) disp disp(' . Thank You for compelete this ..please be a wise consumer:) ) ") 14:19 PM . LUIS In our program, the user will be asked to enter the category code, product code, price and mass of product, packaging code, number of packaging used, purchasing mode. Therefore, we assume that the user knows the mass of the product because the mass of the product is needed to calculate the carbon footprint. For the packaging, we assume that the mass of a cardboard is 0.5kg, mass of a plastic is 0.059kg, mass of a wooden crate is 7.256kg. Hence, the program will ask the user to enter the number of packaging used and then calculate the carbon footprint of packaging. To make the comparison of carbon footprint between the different purchasing modes, we also assume the situation for the user so that users do not need enter too complex input. If user's purchasing mode is online shopping, we assume the distance between the shop and user's house is 2km to calculate the carbon footprint for physical purchasing mode while if user's purchasing mode is physical mode, we assume that the number of parcels is 1 to calculate the carbon footprint for online purchasing mode. Besides, we also assume that the average distance per parcel is 0.2km/unit parcel so the program calculate the carbon footprint of transportation for online shopping. to can The limitations of our program is that 14:22 OP purchasing moue. Besides, we also assume that the average distance per parcel is 0.2km/unit parcel so the program can calculate the carbon footprint of transportation for online shopping. The limitations of our program is that the user only can choose the products in the same category every time he/she run the program. Besides, if user forgot to enter any value, the program will be terminated because we use SWITCH to determine the code entered by user. If user does not enter any value, the program cannot exceed to the next step because the SWITCH expression must be a scalar or a character vector. Since the coding of our program is quite long (2254 lines), it will take a few seconds for the first time running. After that, it can be run as usual. Moreover, as we know that there are limitless types of products but it's not possible for us to list all products in our database. Hence, there are only 4 categories of product in the database and user only allows to choose the product listed in the database. 3.2 Structure of Program To achieve the purpose of the program, we use many decision and loop conditions in the coding. We use SWITCH statements to halog, welcome to our program $this is team 1 the fussian flets start... main EFcases=0; while 1 choose=input('please choose the categories:'); switch choose case 1 clothes; Estathing= EEcases + clothing: case 2 food: effood=EFcase3+foods; case 3 packaging; efrackaging=EEcases. + Sirackaging; case 4 transportation: eftransportation= EFcases +CFtransport; case 0 break otherwise displ'please enter again!!') end end L (Ctrl) - $ you will get the total carbon footprint tasat.sardan= e Estething + estend + efrackaging teisransportationi Eprintf(" total carbon footprint is $d in kg ', total carbon) time to choose the she type of material of clothes that disp('hallo... its you use) ef5=37: ef6=8 ef7-19: ef8=7 Sask user to enter the type of material of clothes fprintf("the type of material of clothes: ') fprintf( 1. nylon 'hi Erringel' 2. cotton ' Eprintfl' 3. peixaterini Ebbinsel' 4. woolin' clothing=input('please enter the name of the material of clothesis'); switch clothing case 'nylon. ef5-37: weight=input('please input the weight of the material of clothes in kg); clothing, e5*weight; case cotton ef6=8! weight=input('please input the weight of the material of clothes in kg'); clothing= ef6"weight; case 'polyster' ef7=19: weight=input('please input the weight of the material of clothes in kg); clothing e7*weight; case wool ef8-7; weight=input('please input the weight of in kg"); clothing- e8*weight: the material of clothes otherwise disp('typo!! please enter again!!') end Erkins64'the carbon emission of your product is: $d Dewedsthing) displ ........ Thank You...... displ - please be a wise consumer: Font G Paragraph Styles 27 Editing wwwwwwwww WWWWWWWWWWWWW Seffood & haloo, welcome to our program $this is team 1 the fussions flets start... $ please read xlsx file the types of food= Leadtable ('Food.xlsx'); disp. (thetypesoffood) ef=table2array (thetypesoffood (:,2)); product=input('please enter the product number:'); weight=input('please enter how much mass you bought:'); foods=ef (product) *weight; fprintf('this is the carbon emissions in your food : $d ', foods) disp(' .....lets continue to the next categories.....') wwwwwwwwwww disp('hallo... its time to choose the packaging you use') ef1=750; ef2=2690; ef3=3640; ef4=3470; Sask user to enter the type of packaging fprintf('the types of the packaging: ') fprintf(' 1. glass '); fprintfl' 2. PP (film/bags) '); fprintfl' 3. PP rigid (boxes/crates) '); fprintf('4. other plastics '); cfpackaging=input('please enter the name of packaging that you use most commonly); switch cfpackaging case 'glass! weight=input('please input weight of package in kg'); cfpackaging= ef1*weight; case 'PP (film/bags) weight=input('please input weight of package in kg'); cfpackaging= ef2*weight; case 'PP rigid (boxes/crates) weight=input('please input weight of package in kg'); cfpackaging= ef3*weight; case 'other plastics' weight=input('please input weight of package in kg'); cfpackaging= ef4*weight; otherwise disp('typo!! please enter again!!') end fprintf('the carbon emission of your product is: %d ', cfpackaging) disp(' .... Thank You..... disp(' .....please be a wise consumer:) .) disp('hallo... its time to input distance and fuel economy that you use') distance = input ('please input your distance in km:'); fueleconomy = input('Input your fuel economy in km/L:'); vol = distance/fueleconomy; fprintf('Amount of fuel consumed: $d Liter', vol) $ask user to enter the type of fuel fueltype = input ('Input your fuel type, 1: Gasoline/Patrol 2:Diesel 3. Aviation Gasoline 4.Jet Fuel:'); switch fueltype case 1 CFtransport = vol *2.032; case 2 CFtransport = vol *2.641; case 3 CFtransport = vol *2.212; case 4 CFtransport = vol +2.522; end fprintf ("Carbon footprint of your trip was: $d KgCo2 ',CFtransport) disp disp(' . Thank You for compelete this ..please be a wise consumer:) ) ") 14:19 PM . LUIS In our program, the user will be asked to enter the category code, product code, price and mass of product, packaging code, number of packaging used, purchasing mode. Therefore, we assume that the user knows the mass of the product because the mass of the product is needed to calculate the carbon footprint. For the packaging, we assume that the mass of a cardboard is 0.5kg, mass of a plastic is 0.059kg, mass of a wooden crate is 7.256kg. Hence, the program will ask the user to enter the number of packaging used and then calculate the carbon footprint of packaging. To make the comparison of carbon footprint between the different purchasing modes, we also assume the situation for the user so that users do not need enter too complex input. If user's purchasing mode is online shopping, we assume the distance between the shop and user's house is 2km to calculate the carbon footprint for physical purchasing mode while if user's purchasing mode is physical mode, we assume that the number of parcels is 1 to calculate the carbon footprint for online purchasing mode. Besides, we also assume that the average distance per parcel is 0.2km/unit parcel so the program calculate the carbon footprint of transportation for online shopping. to can The limitations of our program is that 14:22 OP purchasing moue. Besides, we also assume that the average distance per parcel is 0.2km/unit parcel so the program can calculate the carbon footprint of transportation for online shopping. The limitations of our program is that the user only can choose the products in the same category every time he/she run the program. Besides, if user forgot to enter any value, the program will be terminated because we use SWITCH to determine the code entered by user. If user does not enter any value, the program cannot exceed to the next step because the SWITCH expression must be a scalar or a character vector. Since the coding of our program is quite long (2254 lines), it will take a few seconds for the first time running. After that, it can be run as usual. Moreover, as we know that there are limitless types of products but it's not possible for us to list all products in our database. Hence, there are only 4 categories of product in the database and user only allows to choose the product listed in the database. 3.2 Structure of Program To achieve the purpose of the program, we use many decision and loop conditions in the coding. We use SWITCH statements to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago