PDA

View Full Version : Need help on c++ homework


pleasecompletetherequired
05-06-2010, 03:49 AM
Ok, so i am at the end of the year and Ive caught up on all my labs and homework, I just found out that I had just needed one lab that I never did. I have about an hr to finish it and I came here to ask for help. I will start coding after I post this but if you can please send any advice. Here are the instructions



1. This lab will be in phases that allows for an orderly design and development process.

Phase A. Write a driver program with a do while loop that inputs an integer number in the range from 0 to 255. Validate the number is in the legal range using a while loop.

Phase B. Code a convDecToBin function, based upon the class discussion and the text (pages 132 - 133 of Schneider). This function is designed to take in a decimal value and print out the binary equivalent. This function has one integer argument and returns nothing. You may not use C++ library functions to complete this phase of the assignment. Test your program, especially 0, and verify it works properly. You should store the Boolean values from the '%' operation in an array of bools that contains 8 elements (declare the 8 as a global constant so you do not have to pass the size of the array between functions).

Phase C. In this phase of the program we will remove the printing from the conversion function and write another function to do the printing. Modify your convDecToBin function so that it return the Boolean array. This array should contain the Boolean digits in the correct order (the reverse of from how they were generated). Write a function that will print the Boolean result.

Phase D. Code a convBinToDec function, based upon the class discussion and the text (pages 130 - 132 of Schneider). This function will take in the Boolean array and return an integer that represents the value of the information in the Boolean array. Use a function to output both the integer and Boolean values. You can use this function to ensure you properly did both conversion. Verify your program works properly.

2. Prepare a lab report/documentation package. All of these items do not need to be in the same file or word document, but the main lab report file must reference each item by name. Make sure a digital copy of each item is attached to the email. The lab report must includes the following information for the final program (phase C):


EDIT: I deleted my last one, because I forgot to add the language I was working with and it would not let me edit the title.

a334jv2df
05-06-2010, 03:53 AM
You realize you can pretty much google any 100 level CS "program" and copy/paste? I don't suggest this obv if you're a cs major.

If you post your code I can help you. I'm not going to code the whole thing tho