473,416 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

I can not figure out how to set the first, second, and third to equal correctly.

I have to write a application that creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output. Do not let the first three digits to contain an 8 or 9, and also the first digit cannot be 0(area code can’t start with a 0).The second set of three digits is not greater than 742(do not determine individually). The last four digits will be from 0 to 9999. Each digit does NOT have to be determined separately.
Oct 25 '10 #1
1 1347
jkmyoung
2,057 Expert 2GB
Alright, what problem are you having with your current program? What do you mean by first second and third? Do you mean sets of digits or each digit?

Are you determining each digit seperately, or are you trying to group digits?
Oct 25 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: johkar | last post by:
I need to document.write out a select list populated with the dates for the first and third Wednesday of each month. How do I get to the actual days? <select name="mySelect"> <option value="Oct...
8
by: Hunter Hou | last post by:
hello, I'm reading <the C++ programming language>, here's a question for bind2nd. Who can help explain what on earth bind2nd is working? .... void rotate_all( list<Shape*>& ls, int angle ) {...
4
by: aliensite | last post by:
My code is too greedy, how can it be fixed? Here is my code: Desired output - First:,Second:,Third: <br> <script type="text/javascript"> var regEx = /*?:/g; var html = "<br>First:ratio<br...
8
by: Henrik Larsson | last post by:
Hi, I need help with selecting the following rows from a table looking like this: ID IP Query 1 -> 1 2.2.2.2 (ie first IP 1 1.1.1.1 <- Query 2 for each...
2
by: George | last post by:
The flow of my app is as follows 1) Pull up an order and change the quantity of a textbox item. (Ex: change the quantity from 1 to 2 2) Click on the Update button 3) When the page posts back you...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
1
by: Dilip | last post by:
I have piece of code that breaks apart a string filled with spaces into distinct strings each containing the apporpriate non-whitespace characters using sscanf char encodedsymbol = "IBM RRR...
1
by: Giovanni Toffoli | last post by:
Hi, I'm not in the mailing list. By Googling, I stepped into this an old post: (Thu Feb 14 20:40:08 CET 2002) of Jeff Shannon:...
3
by: Grizlyk | last post by:
Hello. I am thinking: why if i will comment lines marked with '#' in the following example, all will be compiled, else will not: // *********************** typedef unsigned uint; ...
1
dlite922
by: dlite922 | last post by:
I spent a couple hours on this and wanted to save someone else a few hours. This function takes a percentage value and calculates the RGB color. This is useful for a graph or table in which you...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.