• 100% Satisfaction Guarantee

Category: Homework
Satisfied Customers: 1796
Experience:  Inner-city high school substitute teacher. Degrees in mathemetics, accounting, and education. Years and years of tutoring.
29937297
Ray Atkinson is online now

# Create a QBasic program that a numeric value and return the

### Resolved Question:

Create a QBasic program that a numeric value and return the number of thousand,hundred,tens and units it contained.
the numeric value entered must be between 0 and 99999 inclusive.
Submitted: 1 year ago.
Category: Homework
Expert:  Ray Atkinson replied 1 year ago.

Ray Atkinson :

I want to make sure I understand. You want to have the user input a number and have the program return the number of thousands, the number of hundreds, the number of tens, and the number of ones?

Customer:

so please work out an example for me. let say:

Customer:

INPUT:12000

Customer:

OUTPUT:

Customer:

Thousand: 12

Customer:

how wilthe program look like?

Ray Atkinson :

Do you want it to say "Hunderds: 0" or suppress it?

Ray Atkinson :

should it catch if the number is XXXXX an integer?

Customer:

pls both if u don't mind

Ray Atkinson :

Not a problem.

Ray Atkinson :

Do you want me to explain the run of the program, or just type it up?\

Customer:

type it then explain

Ray Atkinson :

Ok, give me a couple minutes, and I will type up a word file.

Customer:

ok i will be waiting

Ray Atkinson :

start: Input x

if x<0 or x>99999 or x<>int(x) then goto start

q=int(x/1000): if q>0 then print “Thousands:”; q: x=x-1000*q

q=int(x/100): if q>0 then print “Hundreds:”;q: x=x-100*q

q= int(x/10): if >0 then print “Tens:”; q: x=x-10*q

if x>0 then print “Ones:”; x

Ray Atkinson :

The first line puts a label and asks for input

Customer:

ok

Ray Atkinson :

the second catches negative number, numbers that are too large, and non-integers

Ray Atkinson :

the next line calls the number of thousands Q and prints how many there are, and reduces x by that many thousands.

Ray Atkinson :

the next lines do the same for hundreds, tens, and ones.

Ray Atkinson :

oops. I missed a q on the "tens" line.

Customer:

ok

Ray Atkinson :

I'm sure you can make it look fancier with a message of some kind on line 2 and some more wording with the messages, of you wanted.

Ray Atkinson :

You also probably want a better prompt for the user than just a ? for them to input the number.

Customer:

ok so basically am am i doing a division operation?

Ray Atkinson :

I just gave the skeleton on the program.

Customer:

yeah i konw

Ray Atkinson :

"int" returns the integer of a division problem.

Customer:

thanks let me work my way around it and get back to u should i not get something.

Ray Atkinson :

If you start with a number like 14358, the first line divides that by 1000, gets 14.358 and int makes it 14.

Ray Atkinson :

it prints the 14, and then takes 14*1000 away from x, so 14358-14000=358

Ray Atkinson :

Hmmm. You don't want it to say that there are 143 hundreds in that example, so you?

Ray Atkinson :

You want 14 thousands, 3 hundred, 5 tens, and 8 ones, right?

Customer:

yes

Ray Atkinson :

oh, good. I w2as afraid I misunderstood.

Ray Atkinson :

I will be here most of the day if you have any questions. When you are satisfied, please remember to rate my answer.

Customer:

so x is what the person will input right

Ray Atkinson :

yes.

Category: Homework
Satisfied Customers: 1796
Experience: Inner-city high school substitute teacher. Degrees in mathemetics, accounting, and education. Years and years of tutoring.
Expert:  Ray Atkinson replied 1 year ago.
Can you not see the solution above?
Expert:  Ray Atkinson replied 1 year ago.

start: Input x

if x<0 or x>99999 or x<>int(x) then goto start

q=int(x/1000): if q>0 then print "Thousands:"; q: x=x-1000*q

q=int(x/100): if q>0 then print "Hundreds:";q: x=x-100*q

q= int(x/10): if >0 then print "Tens:"; q: x=x-10*q

if x>0 then print "Ones:"; x

Customer: replied 1 year ago.

thanks so much

Expert:  Ray Atkinson replied 1 year ago.
You are quite welcome. I'm glad I could help.
Customer: replied 1 year ago.

hi good day

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

### What Customers are Saying:

• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
• This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
• Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
• I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
• Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
• Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
• He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX

• ### Manal Elkhoshkhany

#### Satisfied Customers:

4522
More than 5000 online tutoring sessions.
< Last | Next >

### Manal Elkhoshkhany

#### Satisfied Customers:

4522
More than 5000 online tutoring sessions.

### LogicPro

#### Satisfied Customers:

3458
Expert in Java C++ C C# VB Javascript Design SQL HTML

### Linda_us

#### Satisfied Customers:

3124
Post Graduate Diploma in Management (MBA)

### Chris M.

#### Satisfied Customers:

2385
Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

### F. Naz

#### Satisfied Customers:

1988
Experience with chartered accountancy

### Bizhelp

#### Satisfied Customers:

1876
Bachelors Degree and CPA with Accounting work experience

### Seanna

#### Satisfied Customers:

1781
3,000+ satisfied customers, all topics, A+ work

## Related Homework Questions

Chat Now With A Tutor
Ray Atkinson
597 Satisfied Customers
Inner-city high school substitute teacher. Degrees in mathemetics, accounting, and education. Years and years of tutoring.