Answer to Question #174468 in Algorithms for Kwame Hayford

Question #174468

Question 2

A) The AIT canteen wants you to write a script for them which would do the following

I) receive records from the user and keep these records into a file, the records must include

 ID

 Name of meal

 Price of meal

 Quantity bought today

 Sales made for the day

 2

 

  Today the sales person wants to make seven entries into the file via the command line interface.

Your script should be able to find to present the sales person with the ability to

 Search for a particular meal by ID

 Search for a particular meal by name

 find out how much money has been made from the sales of a particular

meal

 list all records

 list all meals and their prices

 list a particular meal and its price

B) With a shell script explain how to use case

C) With code explain how the following work

 if statements

 if else statements

 if elif else fi statements


D) Explain the difference between= grep -i "some string" some file and grep -iw "some string" some file

[


1
Expert's answer
2021-04-06T02:58:51-0400
SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `receive_records` (
  `id` INT NOT NULL,
  `Name_of_meal` VARCHAR(45) NOT NULL,
  `Price_of_meal` VARCHAR(45) NOT NULL,
  `Quantity_bought_today` VARCHAR(45) NOT NULL,
  `Sales_made_for_the_day` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB;
select * from meal where meal.id=1;

select * from meal where name='abc';

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS