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 Raj Your Own Question

Raj
Raj, Engineer
Category: Homework
Satisfied Customers: 1259
Experience:  4 + Experiance in IT Industry
16752232
Type Your Homework Question Here...
Raj is online now
A new question is answered every 9 seconds

In Pseudocode write an object-oriented program will be written

Resolved Question:

In Pseudocode write an object-oriented program will be written using a class definition, a main program, and defining methods based on the data defined in the class. The main program will allocate an object based on the class.

Write a program that inputs (from the user) the number of hours worked and hourly pay rate for employees and outputs their total pay. The program should process an arbitrary number of employees; the user will terminate input by entering 0 for hours worked and pay rate. Use a class called worker with
• Attributes: Hours, Rate, Total
• Methods: ComputeTotal( ) and access methods ( SetHours( ), GetHours( ), SetRate( ), GetRate( ), SetTotal( ), and GetTotal( ) ) for each of the attributes.
Submitted: 11 months ago.
Category: Homework
Expert:  Raj replied 11 months ago.
Hi There,

I will be helping you with the solution.
By when do you need the solution file?

Thank you
Customer: replied 11 months ago.

9/27/13

Expert:  Raj replied 11 months ago.
I will have the solution code file ready before that.

Have a Good Day
Expert:  Raj replied 11 months ago.
Solution file is ready.

Please download the PSeudocode Solution in Text File from the link below:
http://www.mediafire.com/download/l4v145r3zyna41y/Worker_Class.txt

If you face any difficulty than feel free to ask for help.

If the solution file is satisfactory than Please don't forget to RATE the Answer.
It will hardly take few seconds to RATE my Answer

Thank You and Have a Good Day.
Raj, Engineer
Category: Homework
Satisfied Customers: 1259
Experience: 4 + Experiance in IT Industry
Raj and 7 other Homework Specialists are ready to help you
Customer: replied 11 months ago.

Raj,


 


Please adjust the code from my professor's feedback:


 


Your class looks good accept for the return. For example, functions should look like this:

Public Function GetTotal() As Float
Set GetTotal = Total
End Function

Your declarations are missing the "As"

Use != instead of NOT EQUALS

Thank you,


 


Todd

Expert:  Raj replied 11 months ago.
Ok

I have modified the solution.

Please download the updated code from the link below:
http://www.mediafire.com/download/iwdkkfl0oa2rdh4/Worker_Class.txt

If you face any difficulty than feel free to ask for help.

If the solution file is satisfactory than Please don't forget to RATE the Answer.
It will hardly take few seconds to RATE my Answer

Thank You and Have a Good Day.
Customer: replied 11 months ago.

Declarations are still missing the "As"

Expert:  Raj replied 11 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.
Customer: replied 11 months ago.

Raj,


 


Some more critiques from my professor



Class:
-You need to add the constructor to set the default for the variables.

Main:
-You have not told the user how to exit
-You need input statements to get data from the user
-Give the user more information about what the program is doing, like this:

Declare Worker1 As Worker
Declare HoursWorked As Float
Declare PayRate As Float
Write "Enter an employee's hours worked and hourly pay rate"
Write "and this program will compute his or her total wages."
Write "To quit, enter 0 for both hours worked and pay rate."
Write "Enter the number of hours worked:"
Input HoursWorked
Write "Enter the employee's rate of pay:"
Input PayRate
While (HoursWorked != 0) AND (PayRate != 0)
Call Worker1.SetHours(HoursWorked)
:
:
:
End While

Expert:  Raj replied 11 months ago.
Will it be fine if i provide you solution in next 6 hrs. with changes?
Customer: replied 11 months ago.
yes
Customer: replied 11 months ago.

Raj,


 


Have you had a chance to make the corrections?

Expert:  Raj replied 11 months ago.
Class:
-You need to add the constructor to set the default for the variables. - HAVE IMPLEMENTED it IN MODIFIED VERSION BELOW.

Main:
-You have not told the user how to exit - I HAVE SPECIFIED THIS ALREADY WHEN ASKING FOR hrs. and rate you can check code in which i have specified as (0 - Exit) for both Hours and Rate.

-You need input statements to get data from the user - ALREADY IMPLEMENTED - This Part is already there because user is Entering the value for Hours and Rate using the following statement:
Get hrs and Get rte

-Give the user more information about what the program is doing, like this: - HAVE MODIFIED THE CODE AND INCLUDED.

Please download the Modified code from the link below:
http://www.mediafire.com/?qjxpmbv9lh99bzw
Customer: replied 11 months ago.

Raj,


 


Still needs a little work:


 


Getting there.

-Your constructor is not declared properly ... see page 455, lines 5-8
-You still need to replace "Get count" with an input statement


 


The example constructor that he is referencing is:


 


Public Cube()


Set Side = 1.0


Set Volume = 1.0


End Constructor

Expert:  Raj replied 11 months ago.
Get count is an Input statement or is it used in some other format in your pseudocode lesson?
If yes, than let me know is it like "Input count" or something?
Customer: replied 11 months ago.

I think that the statement Get Count needs to replaced with Input Count

Expert:  Raj replied 11 months ago.
Ok Got it.
Am doing changes.
Check back for updated Pseudocode in next 15 min.
Expert:  Raj replied 11 months ago.
Changes are done.
I also noticed that For displaying the message I think in your class they use WRITE instead of Display so have changed that as well.

I also noticed that there is no use of count so I have removed it.

Also Constructor one has been solved based on format you provided to me.

Please download the updated code from the link below:
http://www.mediafire.com/?19v804lntl4cczq
Customer: replied 11 months ago.

Raj,

 

The code still needs to have the following corrected:

 

We use Float, not Double.

You are getting attributes before they are set.

You should have the user input the hours and rate before the while loop.

 

Like this:
Write "Enter the number of hours worked:"
Input HoursWorked
Write "Enter the employee's rate of pay:"
Input PayRate

Remove the methods from the while loop since the attributes have not been set
While (HoursWorked != 0) AND (PayRate != 0)

 

I removed the second constructor and edited the syntax according to his suggestions below, then resubmitted the code thinking that would be the final editing needed. Then he sent back the feedback above.

 

You have two constructors declared ... remove one

Make sure you syntax is consistent. Review your code for proper capitalization

Expert:  Raj replied 11 months ago.
ok
Customer: replied 11 months ago.

Raj,


 


I need a corrected version ASAP. When can I expect this?


 


Thank you for working with me.


 


Todd

Expert:  Raj replied 11 months ago.
Can you send me the version you have submitted so that I can do changes in that directly.
Customer: replied 11 months ago.

Class worker


Private Declare Hours As Integer
Private Declare Rate As Double
Private Declare Total As Double


Public worker()
Set Hours = 0
Set Rate = 0.0
Set Total = 0.0
End Constructor


Public Function ComputeTotal()
Set Total = Hours * Rate
End Function


Public Function SetHours(hr)
Set Hours = hr
End Function


Public Function SetRate(rt)
Set Rate = rt
End Function


Public Function SetTotal(ttl)
Set Total = ttl
End Function


Public Function GetHours()
Set GetHours = Hours
End Function


Public Function GetRate()
Set GetRate = Rate
End Function


Public Function GetTotal()
Set GetTotal = Total
End Function


End Class



APPLICATION :


Main Method


Declare WRKR As Worker
Declare hrs As Integer
Declare rte As Double



Write "The program will compute Employee's total wages based on User input of hours worked and hourly pay rate."


DO While ((WRKR.GetHours() != 0) AND (WRKR.GetRate() != 0))
Write "Enter Number of Hours Worked or 0 to exit : "
Input hrs
Call WRKR.setHours(hrs)
Write "Enter Rate per Hour Worked or 0 to exit : "
Input rte
Call WRKR.setRate(rte)
Call WRKR.ComputeTotal()


If((WRKR.GetHours() != 0) AND (WRKR.GetRate() != 0)), Then
Write "Number of Hours Worked : " + WRKR.GetHours() + " Hours."
Write "Rate per Hour : $" + WRKR.GetRate()
Write "Total Money Earned by Worker : $" + WRKR.GetTotal()
End If
End While


End Main Method

Expert:  Raj replied 11 months ago.
Ok got it am working on it now.
Expert:  Raj replied 11 months ago.
I have done the changes asked above.

Please download the modified PSeudocode from the link below:
http://www.mediafire.com/?jj56z7oc7qaogyf

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:

    4520
    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:

    4520
    More than 5000 online tutoring sessions.
  • 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:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • 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:

    2341
    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:

    1975
    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:

    1873
    Bachelors Degree and CPA with Accounting work experience