CS 2410

CS 2410

CS 2410

Workshop Make-Up Assignment 

Write a C++ program that will output to a file called output.txt EVERY 10 digit phone number from 713-000-0000 through 713-000-0998. These numbers MUST only contain an odd number of even digits.

Example:

713-000-0000

713-000-0002

713-000-0004

713-000-0006

713-000-0008

713-000-0011

 

…[Several numbers are not shown here]

 

713-000-0484

713-000-0486

713-000-0488

713-000-0491

713-000-0493

713-000-0495

713-000-0497

713-000-0499

713-000-0501

 

…[Several numbers are not shown here]

 

713-000-0989

713-000-0990

713-000-0992

713-000-0994

713-000-0996

713-000-0998

There should only be one number displayed per line. The numbers need to have the appropriate ‘-‘ as shown above. Do not hard code this solution. You need to use Boolean expressions to determine which number gets outputted.  This Boolean expression must use at least 1 bitwise operator (50 points). 

1 point is deducted for each false positive number that your program outputs.

1 point is deducted for each missing number.

Notes:

Turn this into the Blackboard Dropbox labeled “Workshop Make-Up Assignment”.  Do not email me your solution.  Name your .cpp file as “Your_Name.cpp”.  Only turn in the .cpp file.

You can only turn in this assignment if you have not attended any workshops.  This is worth half of your attendance grade.  You do not need to do this assignment if you have attended at least 1 workshop.

The bitwise operators can be found in Appendix J.  This has been uploaded to Blackboard.

You will only be allowed to turn in a C++ program once for this assignment.

 

 
Powered by