Your contribution can guide someone’s learning journey. Share your
documents today.
Q no 1 Answer: IPO Chart: InputProcessOutput Phone numberGet phone number from userCountry name Extract the country code from the phone number Identify the country using the country code Display the country name Q no 2 Answer: Pseudo code: Mobile_Usage//Main algorithm for determining the mobile use and display warning message Get mobile_usage_in_min //Checking if mobile_usage_in_min is less than 1 hour (Since 1 hour is equal to 60 minutes) IF mobile_usage_in_min < 60 THEN DISPLAY "Usage is acceptable" //Checking if mobile_usage_in_min is greater than or equal to 1 hour and less than 2 hours ELSE IF 60 <= mobile_usage_in_min && mobile_usage_in_min < 120 DISPLAY "Mediocre Usage" //Checking if mobile_usage_in_min greater than 2 hours or not ELSE IF 120 < mobile_usage_in_min DISPLAY "Warning, using your phone more than 2 hours per day can affect your health" ENDIF END Q no 3 Answer: Pseudo code: //Main Algorithm to read data from a file, Calculate ticket price and write to another file Calculate Zoo_Ticket_Price Initialise Write_Headings
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
REPEAT Read_Input Calculate_Price Write_to_File UNTIL EOF Finalisation END //Initialising the variables and opening the files Initialise OPEN Family_Info.xlsx OPEN Ticket_Prtice.xlsx family_name = "" number_of_adults = 0 number_of_teenagers = 0 number_of_children = 0 number_of_infants = 0 total_ticket_price = 0 adults_ticket_price = 37 teenagers_ticket_price = 25 children_ticket_price = 18 END //Writing headings in Ticket_Prtice.xlsx file Write_Headings WRITE "Family Name, Total Ticket Price” TO Ticket_Prtice.xlsx END //Reading inputs from Family_Info.xlsx file Read_Input READ family_name, number_of_adults, number_of_teenagers, number_of_children, number_of_infants FROM Family_Info.xlsx END
//Calculating the total Ticket Price for each family Calculate_Price total_ticket_price = (number_of_adults * adults_ticket_price) + (number_of_teenagers * teenagers_ticket_price) + (number_of_children * children_ticket_price) END //Writing the results to the file Ticket_Prtice.xlsx Write_to_File WRITE family_name, total_ticket_price TO Ticket_Prtice.xlsx END //Closing the both file Finalisation CLOSE Family_Info.xlsx CLOSE Ticket_Prtice.xlsx END Q no 4 Answer: Pseudo code: //Main Algorithm to forecast the rain Rain_Forecast Initialise_Variables Get_Valid_Temperature Get_Valid_Humidity Display_Message END //Initialising the Variables Initialise_Variables temperature = 0 humidity = 0 END //Will take input from the user for Temperature and validate it
Get_Valid_Temperature REPEAT DISPLAY "Please enter the temperature" GET temperature IF ! (-20 < temperature && temperature < 55) DISPLAY "Invalid input. Temperature should be between -20 and 55." ENDIF UNTIL -20 < temperature && temperature < 55 END //Will take input from the user for Humidity and validate it Get_Valid_Humidity REPEAT DISPLAY "Please enter the humidity" GET humidity IF !(0 < humidity && humidity <= 100) DISPLAY "Invalid input. Humidity should be a positive integer equal or less than 100." ENDIF UNTIL 0 < humidity && humidity <= 100 END //Displaying the Rain Chances Display_Message IF temperature < 0 && humidity < 20 DISPLAY "Chance of Rain is 0%"; ELSEIF (0 < temperature && temperature < 15) && (20 < humidity && humidity < 40) DISPLAY "Chance of Rain is 20%";
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser