How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask LogicPro Your Own Question

LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 9673
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Please Help!! Ive been working on this programming assignment

Resolved Question:

Please Help!! Ive been working on this programming assignment for about 15 hours and its due in about 7 hours. I could really use you expertise!

I am working on a menu driven program with 4 user input options. I first built the program using case statements declared as chars 'A', 'B', etc. I now need to turn the case statements into their own functions which will be in a separate file called functions.h. I have typed the code to this point, but am just not able to get it to run correct. Here's the assignment:

Modification 1: You will convert each of your four menu options from Programming Assignment 1 into a functions. For example, case 1: instead of having the code in the case statement to print your products, you will call a global function that will print the products out. It will look like:

case 1:

printProducts(YOUR_PARAMETER_LIST);

break;

case 2:



These functions will be located in a header file called functions.h. Be sure to include this file at the top of file main.cpp.

Modification 2: Your product information will now be contained in a structure (struct). This structure will house all of the product’s variables (UPC, product name, etc). This structure definition will be in the functions.h header file. You will have all of the same variables as before.

Modification 3: In main, you will create an array of these structures that will hold all of your products. You will also have a constant variable called NUM_PRODUCTS that will hold the number of products that your array has. For this assignment that number is XXXXX but for Programming Assignment 3 that number will increase. You must create your program with scalability in mind, meaning that if I change the value of NUM_PRODUCTS, your code will still work without any further modifications.

Modification 4: When you create a product, you will set their information to the default values used in Programming Assignment 1. The UPC will now be randomly generated and cannot be changed by the user (for a default value it will be 0, but once the product is edited it will be randomly generated). In option 2 (edit), instead of asking the user for a UPC, you will generate a new one (each time a product is edited you will generate an new UPC). The format for the UPC is 1XXXXX [that is a one with five digits after it]; where the X’s are randomly generated. Hint: generate a random number between 1 and 99,999 then add that to 100,000 (think scale and shift like the dice). There will be no error checking for duplicates, if duplicates happen that is okay.

Modification 5: For each of your functions, you will pass as arguments to the function the array and the number of students in the array (remember that arrays are passed by reference).



I have my main.cpp, functions.h and functions.cpp written but not working correct. PLEASEEEEE HELLPPPP!!!!
Submitted: 1 year ago.
Category: Homework
Expert:  LogicPro replied 1 year ago.
Hi,
Welcome here.
My name is XXXXX XXXXX I will help you.

If you have any file(s), Zip all files; upload the zipped file to http://wikisend.com or http://ge.tt and post download link here. Formatting is messed up.


What is the deadline?
Customer: replied 1 year ago.

Hey logicpro,


 


I appreciate your help. Here is the zip file and the url. Cutting it a bit close, the deadline is 12:30pm today western time. Thank you so much, I've been at it for hours upon hours.


 


http://wikisend.com/download/953612/functions.zip


 


functions.zip

Customer: replied 1 year ago.

I apologize I meant mountain standard time

Expert:  LogicPro replied 12 months ago.
can you let me know the deadline in hours
Customer: replied 12 months ago.

Yes sir, the deadline is in 5 hours and thirty minutes. I'll also need a bit of time to write the algorithm, but I'm still working on it myself.

Expert:  LogicPro replied 12 months ago.
Can the deadline be extended to 15 hours
Customer: replied 12 months ago.

No, I wish it could but that is not possible. I'll send u the first program with the switch statement and hopefully that will help.


 


http://wikisend.com/download/567476/prog.cpp

Expert:  LogicPro replied 12 months ago.
ok. I will review and reply ASAP
Customer: replied 12 months ago.

Thank you

Expert:  LogicPro replied 12 months ago.
Welcome
Expert:  LogicPro replied 12 months ago.
I will provide you answer in 1 hour.
Customer: replied 12 months ago.

fantastic! thank you logicpro, I hope to be as savvy as you one day!

Expert:  LogicPro replied 12 months ago.
Welcome...
Expert:  LogicPro replied 12 months ago.
Download answer from here: Functions_CPP.zip

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.

Thank you for using this site!

Customer: replied 12 months ago.

Thank you logicpro, everything looks solid except when I compiled it returned



functions.cpp: In function ‘void EDIT_CHOICE(Product*, int)’:
functions.cpp:58: error: ‘srand’ was not declared in this scope
functions.cpp:59: error: ‘rand’ was not declared in this scope


 


 


I assume it just needs to be declared in that function as int srand?

Expert:  LogicPro replied 12 months ago.
I will check and reply
Customer: replied 12 months ago.

thank you sir


 

Expert:  LogicPro replied 12 months ago.
Which C++ compiler you are using?
Customer: replied 12 months ago.

winSCP

Expert:  LogicPro replied 12 months ago.
put
#include<cstdlib.h>
Customer: replied 12 months ago.

ok, what is that? I have not learned that library yet


 


after compiling it returned


 



main.cpp:4:21: error: cstdlib.h: No such file or directory
functions.cpp:5:21: error: cstdlib.h: No such file or directory
functions.cpp: In function ‘void EDIT_CHOICE(Product*, int)’:
functions.cpp:59: error: ‘srand’ was not declared in this scope
functions.cpp:60: error: ‘rand’ was not declared in this scope

Expert:  LogicPro replied 12 months ago.
Try after putting:
#include <cstdlib>

instead of
#include <cstdlib.h>
Customer: replied 12 months ago.

Sweet, compiled and executed perfectly. You are a life saver and a scholar. Thank you so much.


A few questions....


 


what is the #include cstdlib and the time.h and what are they used for?


 

Expert:  LogicPro replied 12 months ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
LogicPro, Engineer
Category: Homework
Satisfied Customers: 9673
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
LogicPro and 7 other Homework Specialists are ready to help you
Customer: replied 12 months ago.


right, so what purpose do they serve? like cmath includes the math library function to solve equations and rand is the random number generator


 

Expert:  LogicPro replied 12 months ago.
Yes you are right :)
This header defines several general purpose functions, including dynamic memory management, random number generation, communication with the environment, integer arthmetics, searching, sorting and converting.
Customer: replied 12 months ago.

Ok, awesome. I can't thank you enough LogicPro! Hopefully not, but if I ever end up in a bind again I'll be in contact without a second thought. I'll also give my recommendation to anyone else in need. Thank you

Expert:  LogicPro replied 12 months ago.
Welcome :)

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.

Thank you for using this site!

Expert:  LogicPro replied 12 months ago.
Hi MAc,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro

JustAnswer in the News:

 
 
 
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.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...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
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

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

Related Homework Questions