Question
Write a robust python program to create < >. This file consists of the name, age and weight of a kid. Get the number of
Write a robust python program to create <
This file consists of the name, age and weight of a kid. Get the number of kids from the user and according to this number, fill the file. While filling the file, for each kid, you need to get the name from the user, generate a random number for the age which must be between 0 and 10, and according to the formula calculate the weight of that kid. To calculate the weight of a kid, please use the following formula:
weight= ( age * (total number of characters of that persons name) ) / 2
#For example, name: Gl, age: 6 weight: (6 * 3) / 2 9,0 kgs
You can see the sample of <
--Sample file format(Please do not write these data on your file, you need to create a file)
Petra 4 10,0
Yaman 5 12,50
Vega 1 2,0
mr 2 4,0
Teoman 3 9,0
Toprak 8 24,0
Elif 6 12,0
Deniz 9 22,50
Then, read this file(<
Finally display the kid who has the smallest weight in the array. (According to the sample file, the program must print Vega as an output.)
We can not easily make your program crash. THERE SHOULD BE NO BUGS IN THE CODE YOU WROTE. Your program should be very robust. You should handled all exceptions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started