Can you help me figure out how to correctly make a prompt that fits these paramaters?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you help me figure out how to correctly make a prompt that fits these paramaters?

d. increase() which prompts the user to change the value stored in the object. It
repeatedly re-prompts the user until they enter a numeric value larger than the
value currently stored in the object, at which point the method resets the value of
the object to the number obtained from the user. The method must recover from
illegal input of all types, and several examples are shown below. It does not return
any values.
ving shows how the Salary class and its methods could be used:
>>> s1 = Salary()
>>> s1
Salary(31200)
>>>print(s1)
$31200.00
>>> s1.increase()
The current salary is $31200.00.
Enter a new value (>
31200): 31199.99
The value must be larger than the
existing salary.
The current salary is $31200.00.
Enter a new value (> 31200): forty
thousand
Please enter a numeric value using
digits.
The current salary is $31200.00.
Enter a new value (>
31200): 32500.55
>>> s1
Salary(32500.55)
>>>print(s1)
$32500.55
>>> $2=Salary(0)
>>> S2
Please enter a numeric value using
digits.
The current salary is $31200.00.
Enter a new value (>
31200): [3333]
Please enter a numeric value using
digits.
The current salary is $31200.00.
Enter a new value (> 31200): 33300
>>> $2
Salary(33300)
>>>print(s2)
$33300.00
>>> s3 = Salary(17000.8)
>>> $3
Salary(17000.8)
>>>print(53)
$17000.80
>>> s4 = Salary('fifteen thousand')
>>> $4
Salary(31200)
>>> $5 = Salary([33333])
>>> $5
Salary(31200)
>>> s6 = Salary(Measure(5))
Transcribed Image Text:d. increase() which prompts the user to change the value stored in the object. It repeatedly re-prompts the user until they enter a numeric value larger than the value currently stored in the object, at which point the method resets the value of the object to the number obtained from the user. The method must recover from illegal input of all types, and several examples are shown below. It does not return any values. ving shows how the Salary class and its methods could be used: >>> s1 = Salary() >>> s1 Salary(31200) >>>print(s1) $31200.00 >>> s1.increase() The current salary is $31200.00. Enter a new value (> 31200): 31199.99 The value must be larger than the existing salary. The current salary is $31200.00. Enter a new value (> 31200): forty thousand Please enter a numeric value using digits. The current salary is $31200.00. Enter a new value (> 31200): 32500.55 >>> s1 Salary(32500.55) >>>print(s1) $32500.55 >>> $2=Salary(0) >>> S2 Please enter a numeric value using digits. The current salary is $31200.00. Enter a new value (> 31200): [3333] Please enter a numeric value using digits. The current salary is $31200.00. Enter a new value (> 31200): 33300 >>> $2 Salary(33300) >>>print(s2) $33300.00 >>> s3 = Salary(17000.8) >>> $3 Salary(17000.8) >>>print(53) $17000.80 >>> s4 = Salary('fifteen thousand') >>> $4 Salary(31200) >>> $5 = Salary([33333]) >>> $5 Salary(31200) >>> s6 = Salary(Measure(5))
#Do not add any parameters
def
init (self, amount = 31200) :
'Initalizaing balance of salary'
self.bal amount
def
pass
def repr (self):
return f"Salary {self.bal}"
pass
str (self):
'returns string containg the current value stored in object in 2 decimal
return "$" + str (round (self.bal, 2))
pass
def increase (self):
increase = int (input ("The current salary is" + (self.bal) + "Enter a new
pass
Transcribed Image Text:#Do not add any parameters def init (self, amount = 31200) : 'Initalizaing balance of salary' self.bal amount def pass def repr (self): return f"Salary {self.bal}" pass str (self): 'returns string containg the current value stored in object in 2 decimal return "$" + str (round (self.bal, 2)) pass def increase (self): increase = int (input ("The current salary is" + (self.bal) + "Enter a new pass
Expert Solution
Step 1

Please refer below for your reference:

First include all functions in a class 

For ex: class sample:

The prompts can be given through function calls and object in below:

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education