Question: Can someone help me to improve and modify my code to match the output below. The additional calculations for the table are listed below. Additional
Can someone help me to improve and modify my code to match the output below. The additional calculations for the table are listed below.
Additional Requirement:
YOU MUST HAVE COMMENTS FOR YOUR CODE!
YOU ARE REQUIRED TO MEET VIRTUALLY WITH ME TO EXPLAIN YOUR CODE!
THE PROGRAM MUST PROMPT THE USER TO INPUT THE STRING.
YOU MUST USE AT LEAST USER DEFINED FUNCTION!
The output should be displayed on the screen.
Extra Credit: YOU CAN RECIEVE EXTRA CREDIT IF YOU USE A CLASSES
The program should allow any of the following or similar hex strings this means you need an input statement!: CCAAABA
The output should be in tabular format and be displayed as indicated below.
Partition Number Start Sector Size in Sectors End Sector CapacityMB Partition Gap in Sectors
None
x x x
x x x
x the correctly calculated values
Capacity Size in Sectors
End Sector Starting sector Size in Sectors
Partition Gap In Sectors Start of Next Partition End of Previous Partition if no gap exists then print None The example above takes the calculation of the rd partitionnot shown into the formula!
The solution provided contains an error in the code please see attachment self.partitions.aprend
'Partition Number': i
'Start Sector': start sectore
'Size in Sectors': size.insecters
'End Sector': end sester,
'CapacityMB: capacityaMB,
'Partition Gap in Sectors': Rartitiongap if partition. gapp else "None"
def displavapartitionsself:
printPartition Number tstart Sector Ssize in Sectors End Sector tCapacityMBtpartition Gap in
Sectors"
for in self.partitiens:
printf 'Partition Number'tpStart Sector'tpSize in Sectors'tpEnd
Sector'tpCapacityMBMBtpPartition Gap in Sectors'
# User input for the hex string
hex input inputEnter the hex string:
# Creating an object of Partition class and calculating partitions
Rartitionabi. Partitionhex input
Rartitionobj,calculatepartitions
# Displaying the calculated partitions on screen
partitionabjidisplaxapartitionsEnter the hex string:
CCAAABA
Traceback most recent call last:
File
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
