Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
How to switch data in BASIC language?
I have a program about calculating gross pay, storing the last & first names and hour wages in DATA statements.
i.e
.
10 read n$, p
.
20 print "Enter hours worked for";n$;:input h
.
50 print "Grosspay for";n$;"is"; using "$$###.##";h*p
.
100 data "Smith Frank",6.50
.
I need to switch the first and last names so the print statements say "Enter hours worked for Frank Smith?" and "Grosspay for Frank Smith is -" Not "Enter hours worked for Smith Frank?" The last name MUST be first in the data statement. Any ideas? My teacher said it's supposed to be simple, but I can't think of it.
1 Answer
- GardnerLv 77 years agoFavourite answer
Use the Substring command to find the space. Everything before the space is last name, everything after the space is first name
Source(s): VB.NET Programmer