(2) Write a Jeva progrom thet prompts the user to enter two integer numbers a ond b. then it computes the value of e raised to the power of b. The integer number should be typed in by the user in response to a prompt message. Always check the rumber b is a positive number, so your program must keep asking the user to enter b until the user enters a positive number. Se, your program must keep asking the user to enter b. until the user enters a positive number.

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
(2) Write a Jeva progrom thet prompts the user to enter two integer numbers a and b,
then it computes the value of a reised to the power of b. The integer number should
be typed in by the user in response to a prompt message. Aleays check the number b
is a positive number, so your progrom must keep asking the user to enter b until the
user enters a positive number. So, your program must keep asking the user to enter b,
until the user enters a positive rumber.
Hint:
If a= 2 and b = 3, then:
2'-2 2- 0:
Your program must consider the following specifications
• Use Power as the name of your class.
• De NOT use Math powla, b)
• Type your name ond student number obove the class declaration using a
block/parogroph comment.
• Use documentation, comments ond code style
• Use significant and appropriete identifiers.
• Use appropriate data type for the variables.
• Use long type to hold the result.
Here are sample runs of the progrom
Enter a nunber: 2
Enter b number: 3
The value of 2 raised to the power of 3 is 8
Transcribed Image Text:(2) Write a Jeva progrom thet prompts the user to enter two integer numbers a and b, then it computes the value of a reised to the power of b. The integer number should be typed in by the user in response to a prompt message. Aleays check the number b is a positive number, so your progrom must keep asking the user to enter b until the user enters a positive number. So, your program must keep asking the user to enter b, until the user enters a positive rumber. Hint: If a= 2 and b = 3, then: 2'-2 2- 0: Your program must consider the following specifications • Use Power as the name of your class. • De NOT use Math powla, b) • Type your name ond student number obove the class declaration using a block/parogroph comment. • Use documentation, comments ond code style • Use significant and appropriete identifiers. • Use appropriate data type for the variables. • Use long type to hold the result. Here are sample runs of the progrom Enter a nunber: 2 Enter b number: 3 The value of 2 raised to the power of 3 is 8
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Returning value from Function
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
  • SEE MORE 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