Question: Collapse Lesson 3 B - Lab 6 - Places, Please Data File Input Java Module - Lesson 3 B - Lab 6 - Places, Please

Collapse
Lesson 3B- Lab 6- Places, Please Data File Input
Java Module - Lesson 3B - Lab 6- Places, Please
Write a program to input from a data file two 4-digit integers, and for each integer assign to variables the thousands, the hundreds, the tens, and the ones digits, and out ' each one separately with a label indicating its place value. Use / and % operators to mathematically separate out the digits. Create EXACT OUTPUT. DO NOT trivialize this task by inputting the value as a String and then using the charAt method.
Hint: To isolate a place digit in a number, first mod the number by the place BEFORE, then div by the place OF the digit you want. For example, to isolate the hundreds digit of the value 4528, you would do 4528%1000100. The first operation gives you 528, and the second operation results in 5.
Data File Input("
1ab3B6.in"):
4528,8143
 Collapse Lesson 3B- Lab 6- Places, Please Data File Input Java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!