Question: dear prof, file operation in (c) code plz and thanks helping me alot to understand the steps clearly . LAB EXERCISE 2 Tasks: Airspeed Airline


dear prof, file operation in (c) code plz and thanks helping me alot to understand the steps clearly .
LAB EXERCISE 2 Tasks: Airspeed Airline is a domestic airline company. Airspeed has appointed you to develop a sale analysis system. System is intended to facilitate the manager to analyze the sales record. You are given an input file named sale.txt that consists of the following information as in Figure 1. Passenger type Num of Passenger Departure Amval Return Price per Person A C 2 1 3 1 Y Y N N 1 A A A A A A KTN KTN KUL KUL KUL KTG KBR KUL KUL KTG KUL KUL KTG KTN KTN KUL KUL KBR KBR KUL 90.00 85.50 118.00 89.00 84.55 98.00 110.00 110.00 104.50 98.00 N Y Y N N Y 2. 1 2 1 4 Figure 3: sale txt file Your system should allow the following functions with the following processes: . 1. In main function Read the information line by line (in array). b. Call function total fare to get total fare for each line. You must pass the value of return and price per person to the total fare function in order to calculate the total fare. c. After you get all the total fare from the total fare function, the output will be written in the output file as shown in Figure 2. 2. In total fare function This function will calculate the discount of 5% if return in Y b. Total fare will be calculated based on price after discount I number of passenger c. The value of price after discount and total fare will be returned to the main function a 2. In total fare function a. This function will calculate the discount of 5% if return in Y b. Total fare will be calculated based on price after discount x number of passenger c. The value of price after discount and total fare will be returned to the main function SALES RECORD Passenger Type Bil Price/person Return Price After Discount Total Fare A 2 1 3 1 1 2 1 2 90.00 85.50 118.00 89.00 84.55 98.00 110.00 110.00 104.50 98.00 Y N N N Y Y 85.50 81.23 118.00 89.00 84.55 93.10 104.50 110.00 104.50 93.10 171.00 81.23 354.00 89.00 84.55 196.00 104.50 220.00 104.50 372.40 N N Y 4 Total Sales:1776.68 Figure 4 salestatistic txt file Your system would have a few functions such as main and total_fare. c. Based on the problems and user requirement given construct a flowchart or pseudocode to indicate the flow of sale analysis system d. Translate the flowchart or pseudocode into full free error coding Hints functions (main read price, calculate_discount, total_fare), 2-D Array, File
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
