Problem 3 Mr. Tariq Al-Nasri owns a tools design industry in which they are making tools of various shapes. As soon as the order is received, the designer enters the details of the order which comprises tool_code,shape, measurement(s) (one or more as required by the shape). The tools industry requires a menu driven software to support the designer. The following are the tasks to be programmed: (Assume all the records of the binary file are following list format: [tool_code, shape, radius]) i) Write a function to accept details like tool_code, shape, and radius as soon as the order is received. The accepted one record is used to create a binary file called ToolsData.dat ii) Write a function to add records at the end of the binary file ToolsData.dat, after accepting tool_code, shape and radius from the user. iii) Write a function to calculate the Curved Surface Area (CSA) and Total Surface Area (TSA) for each record according to the name of the shape after reading from ToolsData.dat. Add the calculated CSA and TSA at end of each record. (USE append() attribute of the List). The updated records should be written back into ToolsData.dat. iv) Write a function to read and display all the records from ToolsData.dat. Handle EOFError exception when the end of file is reached. v) Write a function to read and display all the records from ToolsData.dat that are of given shape. (For Example, if the user enters "sphere", then all the records related to sphere should be displayed. Or else if the user enters "hemisphere", then all the records related to hemisphere should be displayed.) Supportive details for your reference: Records to be used as input during test run your program. ["T1","sphere",1.25] ["T2","hemisphere", 1.75] ["T3","hemishpere", 2.0] ["T4","sphere",2.25] ["T5"," hemishpere ",3.25] ["T6"," hemishpere ",0.25] ["T7"," hemishpere ",4.25] ["T8","sphere",0.5] ["T9"," hemishpere ",1.0] Formulas to calculate: Shape Name: sphere CSA = 4 nr? TSA = 4 n r? Shape Name: hemisphere CSA = 2 nr? TSA = 3 n r?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Problem 3
Mr. Tariq Al-Nasri owns a tools design industry in which they are making tools of various shapes.
As soon as the order is received, the designer enters the details of the order which comprises
tool_code,shape, measurement(s) (one or more as required by the shape). The tools industry
requires a menu driven software to support the designer.
The following are the tasks to be programmed:
(Assume all the records of the binary file are following list format: [tool_code, shape, radius])
i)
Write a function to accept details like tool_code, shape, and radius as soon as the order is
received. The accepted one record is used to create a binary file called ToolsData.dat
ii) Write a function to add records at the end of the binary file ToolsData.dat, after accepting
tool_code, shape and radius from the user.
iii) Write a function to calculate the Curved Surface Area (CSA) and Total Surface Area (TSA) for
each record according to the name of the shape after reading from ToolsData.dat. Add the
calculated CSA and TSA at the end of each record. (USE append() attribute of the List). The
updated records should be written back into ToolsData.dat.
iv) Write a function to read and display all the records from ToolsData.dat. Handle EOFError
exception when the end of file is reached.
v) Write a function to read and display all the records from ToolsData.dat that are of given
shape. (For Example, if the user enters "sphere", then all the records related to sphere
should be displayed. Or else if the user enters "hemisphere", then all the records related to
hemisphere should be displayed.)
Supportive details for your reference:
Records to be used as input during test run your program.
["T1","sphere",1.25]
["T2","hemisphere",1.75]
["T3","hemishpere",2.0]
["T4","sphere",2.25]
["T5"," hemishpere ",3.25]
["T6"," hemishpere ", 0.25]
["T7"," hemishpere ", 4.25]
["T8","sphere",0.5]
["T9"," hemishpere ",1.0]
Formulas to calculate:
Shape Name: sphere
CSA = 4 n r²
TSA = 4 nr?
Shape Name: hemisphere
CSA = 2 n r?
TSA = 3 n r?
Transcribed Image Text:Problem 3 Mr. Tariq Al-Nasri owns a tools design industry in which they are making tools of various shapes. As soon as the order is received, the designer enters the details of the order which comprises tool_code,shape, measurement(s) (one or more as required by the shape). The tools industry requires a menu driven software to support the designer. The following are the tasks to be programmed: (Assume all the records of the binary file are following list format: [tool_code, shape, radius]) i) Write a function to accept details like tool_code, shape, and radius as soon as the order is received. The accepted one record is used to create a binary file called ToolsData.dat ii) Write a function to add records at the end of the binary file ToolsData.dat, after accepting tool_code, shape and radius from the user. iii) Write a function to calculate the Curved Surface Area (CSA) and Total Surface Area (TSA) for each record according to the name of the shape after reading from ToolsData.dat. Add the calculated CSA and TSA at the end of each record. (USE append() attribute of the List). The updated records should be written back into ToolsData.dat. iv) Write a function to read and display all the records from ToolsData.dat. Handle EOFError exception when the end of file is reached. v) Write a function to read and display all the records from ToolsData.dat that are of given shape. (For Example, if the user enters "sphere", then all the records related to sphere should be displayed. Or else if the user enters "hemisphere", then all the records related to hemisphere should be displayed.) Supportive details for your reference: Records to be used as input during test run your program. ["T1","sphere",1.25] ["T2","hemisphere",1.75] ["T3","hemishpere",2.0] ["T4","sphere",2.25] ["T5"," hemishpere ",3.25] ["T6"," hemishpere ", 0.25] ["T7"," hemishpere ", 4.25] ["T8","sphere",0.5] ["T9"," hemishpere ",1.0] Formulas to calculate: Shape Name: sphere CSA = 4 n r² TSA = 4 nr? Shape Name: hemisphere CSA = 2 n r? TSA = 3 n r?
Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY