Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write pseudocode for this: Item_name=[\'Coffee\',\'Sandwich\',\'Bagel\',\

ID: 3545696 • Letter: P

Question

Please write pseudocode for this:



Item_name=['Coffee','Sandwich','Bagel','Cupcake','Juice'];

Item_cost=[4.99,5.00,3.00,2.50,2.00];

ch='y';

j=1;

Total=0;

str='';

str1='';

str2='';

list=[];

tax=1.5;

while (ch=='Y' or ch=='y'):

         Item=input(" Enter Item name:");

         if ( Item in Item_name ) :

                  Qty=int(input(" Enter Quantity of Item:"));

                  i=Item_name.index(Item);

                  cost=Item_cost[i]*Qty;

                  Total+=cost;

                  str1= (" %d %s" % (Qty, Item));

                  str2=("%g" % (cost));

                  str1=str1.ljust(28," ");

                  str=str1+str2;

                  list.insert(j-1,str);

                  j+=1;

         else :

                  print (" Please Enter Proper Item_Name...!!");

                  continue;

         ch=input(" Want to Order more Item??(y/n):");

print (" Welcome To Paradise");

print (" --------------------------------");

for value in list:

         print (value);

print (" --------------------------------");      

print (" Sub Total ",Total);

print ("Sales Tax ",tax);

print (" TOTAL ",Total+tax);

str3=" Thank You For Your Patronage";

str3=str3.rjust(40," ");

print (str3);

Please write pseudocode for this:

Explanation / Answer

Declare a List called Item_name

Declare a List called Item_cost

Declare a List called list

Declare a float variable called Total

Declare a character variable called ch

Declare a string variable called str

Declare a string variable called Item

Declare a integer variable called Qty

Declare a float variable called tax

Declare a float variable called cost


set Item_name to ['Coffee','Sandwich','Bagel','Cupcake','Juice']

set Item_cost to [4.99,5.00,3.00,2.50,2.00]

set list to []

set Total to 0

set ch to 'y'

set str to ''

set tax to 1.5


while ch is 'y' or 'Y'

Input Item

If Item in Item_name

Input Qty

Set counter to index of Item in Item_name

set cost = Qty * Item_cost[counter]

Add cost to Total

set str to Qty Item and cost

Insert str to list

else

Run loop again

Input ch


print list

print tax

print Total

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote