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 Chris Parker Your Own Question

Chris Parker
Chris Parker, Problem Solver
Category: Homework
Satisfied Customers: 2220
Experience:  Master of Computer Applications (MCA). BSc in Mathematics, Physics, and Computer Science.
4769983
Type Your Homework Question Here...
Chris Parker is online now
A new question is answered every 9 seconds

I need help in pseudocode for the following questions

Resolved Question:

Algorithm

1. Design an algorithm that displays the following menuu gets the user's selection and validates the selectoin

Main Menu
1. Open a new document.
2. Close the current document
3. Print the current document
4. Exit the program
Enter your selection

2. Design a case structure that can be used with the algorithm you designed for Algorithm workbench questions 1. The case structure should call a module named openDocument if the user selected item 1, should call a module named closeDocument if the user selected item 2 and should call a module named printDocument if the user selected item 3

3. Pute the algorithms that you designed for algorithm workbench questions 1 and 2 together inside a loop that redisplays the menu after the user's selected operation is performed or exits if the user selects item 4 from the menu

Programming

3. Geometry calculator

write a program that displays the following menu:
geometry calculator
1. calculate the area of a circle
2. calculate the area of a rectangle
3. calculatle the area of a triangle
4. quit
enter your choice (1-4).
Submitted: 6 years ago.
Category: Homework
Expert:  Chris Parker replied 6 years ago.
HiCustomer

Welcome to Just Answer!

I can help you with this. Can I give this to you by tomorrow morning?

-Chris
Customer: replied 6 years ago.
Reply to XXXXX XXXXX's Post: No problem, thanks for your help. Don't want to overwhelm you, but may I send you some more. I will deposit some more money. Just let me know. Thanks
Expert:  Chris Parker replied 6 years ago.
Sure. Please post your questions here and I will let you know if I can help you with them.

-Chris
Expert:  Chris Parker replied 6 years ago.
HiCustomer

Below is the pseudocode for the four questions. If you find my response helpful, please click on the "Accept" button so that I get credit for helping you.

Regards,
Chris

=================================================================

1)

MENU:

PRINT ‘Main Menu’
PRINT ‘1. Open a new document’
PRINT ‘2. Close the current document’
PRINT ‘3. Print the current document’
PRINT ‘4. Exit the program’

PRINT ‘Enter your selection’
READ selection

IF selection is NOT 1,2,3,or 4
PRINT ‘You entered an invalid selection. Please enter again.’
GOTO MENU
END IF

2)

MENU:

PRINT ‘Main Menu’
PRINT ‘1. Open a new document’
PRINT ‘2. Close the current document’
PRINT ‘3. Print the current document’
PRINT ‘4. Exit the program’

PRINT ‘Enter your selection’
READ selection

IF selection is NOT 1,2,3,or 4
PRINT ‘You entered an invalid selection. Please enter again.’
GOTO MENU
END IF

case 1: CALL openDocument

case 2: CALL closeDocument

case 3: CALL printDocument

3)

REPEAT

MENU:

PRINT ‘Main Menu’
PRINT ‘1. Open a new document’
PRINT ‘2. Close the current document’
PRINT ‘3. Print the current document’
PRINT ‘4. Exit the program’

PRINT ‘Enter your selection’
READ selection

IF selection is NOT 1,2,3,or 4
PRINT ‘You entered an invalid selection. Please enter again.’
GOTO MENU
END IF

case 1: CALL openDocument
clearScreen()
GOTO MENU

case 2: CALL closeDocument
clearScreen()
GOTO MENU

case 3: CALL printDocument
clearScreen()
GOTO MENU

UNTIL selection is NOT EQUAL TO 4

4)

REPEAT

SELECT:

PRINT ‘Geometry Calculator’
PRINT ‘1. Calculate the area of a circle’
PRINT ‘2. Calculate the area of a rectangle’
PRINT ‘3. Calculate the area of a triangle’
PRINT ‘4. Quit’

PRINT ‘Enter your choice’
READ choice

IF selection is NOT 1,2,3,or 4
PRINT ‘You entered an invalid choice. Please enter again.’
GOTO SELECT
END IF

case 1: RADIUS:
PRINT ‘Enter radius’
READ radius
IF radius is NOT a +ve integer
PRINT ‘You entered an invalid radius. Please enter again.’
GOTO RADIUS
END IF

circleArea =3.14 x radius x radius
PRINT circleArea
clearScreen()
GOTO SELECT

case 2: LENGTH:
PRINT ‘Enter length’
READ length
IF length is NOT a +ve integer
PRINT ‘You entered an invalid length. Please enter again.’
GOTO LENGTH
END IF

BREADTH:
PRINT ‘Enter breadth’
READ breadth
IF breadth is NOT a +ve integer
PRINT ‘You entered an invalid breadth. Please enter again.’
GOTO BREADTH
END IF

rectangleArea =length x breadth
PRINT rectangleArea
clearScreen()
GOTO SELECT

case 3: BASE:
PRINT ‘Enter base’
READ base
IF base is NOT a +ve integer
PRINT ‘You entered an invalid base. Please enter again.’
GOTO BASE
END IF

HEIGHT:
PRINT ‘Enter height’
READ height
IF height is NOT a +ve integer
PRINT ‘You entered an invalid height. Please enter again.’
GOTO HEIGHT
END IF

triangleArea =1/2 x base x height
PRINT triangleArea
clearScreen()
GOTO SELECT

UNTIL choice is NOT EQUAL TO 4

===============================================================
Chris Parker, Problem Solver
Category: Homework
Satisfied Customers: 2220
Experience: Master of Computer Applications (MCA). BSc in Mathematics, Physics, and Computer Science.
Chris Parker and 5 other Homework Specialists are ready to help you
Customer: replied 6 years ago.
Reply to XXXXX XXXXX's Post: Chris I send you some more. Thanks
Expert:  Chris Parker replied 6 years ago.
Thanks for the accept. Post your new questions here.

-Chris
Customer: replied 6 years ago.
1. Design a swap module that accepts two arguments of the Real data type and swaps them.

2. What algorithm does the following pseudocode perform?

Declare Integer maxElement
Declare Integer index

For maxElement = arraySize - 1 to 0 Step -1
For index = 0 to maxElement - 1
If array[index] > array[ index + 1] Then
Call swap (array[ index], array [ index + 1] )
   End If
End for
End for

3.What algorithm does the following pseudocode perform?

Declare Integer index
Declare Integer scan
Declare Integer unsortedValue

For index = 1 To arraySize - 1
Set unsortedValue = array [index ]
Set scan = index

While scan ? 0 AND array [scan-1] < array [scan]
   Call swap (array [scan-1], array [scan])
   Set scan = scan - 1
End While

4.What algorithm does the following pseudocode perform?

Declare Integer startScan

Declare Integer minIndex
Declare Integer minValue
Declare Integer index

For startScan = 0 To arraySize - 2
Set minIndex = startScan
Set minValue = array [startScan]

For index = startScan + 1 To arraySize - 1
    If array[ index] < minValue
    Set minValue = array[ index]
    Set minIndex = index
    End If
End For

Call swap[ array[minIndex], array[ startScan])
End For


2. Sorted Names

Design a program that allows the user to enter 20 names into a String array Sort the array in asceding (alphabetical) order and display its contents

ch10

3. Design an algorithm that does the following: opens an output file with the external name number_list.dat uses a loop to write the numbers 1 though 100 to the file and then closes the file

4. Desgin an algorithm that does the following: opens the number_list.dat file that was created by the algorithm creataed in questions 3 reads all the numbers from the file and displays them, and then closes the file

6. The Springfork Amateur golf club has a tournament every weekend. The club president has asked you to design two programs.

1. A program that will read each players name and golf score as eyboard input, and then save these as records in a file named golf.dat *each record will have a file and displays them.

7. Modify program #2 that you wrote for Programming exercise 6 so it also displays the name of the player with the best lowest golf score. you do not not need to read the file into an array to use this technique however it can be adapted for use with a file.
Expert:  Chris Parker replied 6 years ago.
I notice that the same set of questions is posted in the Computer section. I am not part of that section, so I will be unable to answer there. I will opt-out of the new questions and give other experts a chance to assist you.

-Chris
Chris Parker, Problem Solver
Category: Homework
Satisfied Customers: 2220
Experience: Master of Computer Applications (MCA). BSc in Mathematics, Physics, and Computer Science.
Chris Parker and 5 other Homework Specialists are ready to help you
Customer: replied 6 years ago.
Reply to XXXXX XXXXX's Post: I meant to send you the questions. What do I need to do to fix it?
Expert:  Chris Parker replied 6 years ago.

A new thread has been opened in this section and I am addressing your questions there.

-Chris

Customer: replied 6 years ago.
Hi Chris...let me know if you can help me out.

1. What will the following program display?

Module main()
Declare Integer num = 0
Call showMe(num)
End Module

Module showMe(Integer arg)
If arg < 10 Then
Call showMe(arg + 1)
   Else
     Display arg
End If
End Module

2. What will the following program display?
   Module main()
   Declare Integer num = 0
   Call showMe(num)
End Module

Module showMe(Integer arg)
   Display arg
   If arg < 10 Then
    Call showMe(arg + 1)
    End if
End Module

3. The following module uses a loop. Rewrite it as a recursive module that performs the same operation.

Module trafficeSign(int n)
    While n > 0
     Display "No Parking"
     Set n = n - 1
      End While
End Module

Recursive Power Method
5. Design a function that uses recursion to raise a number to a power. The function should accept two arguments: the number to be raised and the exponent. Assume that the exponent is a nonnegative integer.

Ackermann's Function
Ackermann's Function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Design a function ackermann(m,n), which solves Ackermann's Function. Use the following logic in your function:

If m=0 then return n + 1
If n=0 then return ackerman(m - 1, 1)
Otherwise, return ackermann(m - 1, ackermann(m, n-1)
6.
Expert:  Chris Parker replied 6 years ago.

Your 6th question seems to have been cut-off. Could you please post it?

Thanks,

Chris

Customer: replied 6 years ago.
6. Ackermann's Function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Design a function ackermann(m,n), which solves Ackermann's Function. Use the following logic in your function:
If m = 0 then return n + 1
If n+0 then return ackermann(m - 1,1)
Otherwise, return ackermann(m - 1, ackermann(m, n - 1))
Expert:  Chris Parker replied 6 years ago.

HiCustomer

Below is my response to your questions. Please click on "Accept" if you find my response helpful. Let me know if you need any modifications.

Thanks,

Chris

==============================================================

1)

The program will display 10.

2)

The program will display 0 1 2 3 4 5 6 7 8 9 10

3)

Module main()

Declare Integer n

Print ‘Enter n'
Read n
Call trafficSign (n)

End Module

Module trafficSign (Integer arg)

If(arg>0)
Print "No Parking"
n--
Call trafficSign (n)
End If

End Module

5)

Declare Integer result=1

Module main()

Declare Integer number
Declare Integer power

Input1:

Print ‘Enter number'
Read number

If number is XXXXX a positive integer
Print ‘You entered an invalid number. Please enter again.'
Goto Input1
End If

Input2:

Print ‘Enter power'
Read power

If power is NOT a positive integer
Print ‘You entered an invalid power. Please enter again.'
Goto Input2
End If

Call exponent (number,power)
Print ‘Result:' result

End Module

Module exponent (Integer number, Integer pow)

If(pow-1 >=0)
result=result*num
pow--
exponent(num,pow)
End If

End Module

6)

Module main()

Declare Integer m
Declare Integer n
Declare Integer result

result = Call ackermann(m,n)

Print ‘The value of Ackermann's function=' result
End Module

Module ackermann(Integer m, Integer n)
If (m == 0)
Return (n + 1)
Else If (n == 0)
Return (ackermann(m - 1,1))
Else
Return (ackermann(m - 1,ackermann(m,n - 1)));
End If
End If

End Module

==============================================================

 

Chris Parker, Problem Solver
Category: Homework
Satisfied Customers: 2220
Experience: Master of Computer Applications (MCA). BSc in Mathematics, Physics, and Computer Science.
Chris Parker and 5 other Homework Specialists are ready to help you
Customer: replied 6 years ago.
1. Suppose myCar is the name of a class variable that references an object and go is the name of a method. (The go method does not take any arguments). Write a pseudocode statement that uses the myCar variable to call the method.

4. In pseudocode write the first line of the definition for a Poodle class. The class should extend the Dog class.

5. Look at the following pseudocode class definitions

Class Plant
Public Module message()
Display "I'm a plant."
End Module
End Class
Class Tree Extends Plant
Public Module message()
Display "I'm a tree."
End Module
End class

Given these class definitions, what will the folowing pseudocode display?

Declare Plant p
Set p = new Tree()
Call p.message()
Customer: replied 6 years ago.
1. Pet Class

Design a class named Pet, which should have the following fields:

name-The name field holds the name of a pet.
type-The type field holds the type of animal that a pet is. Example values are "Dog","Cat", and "Bird"
age-The age field holds the pet's age.

The Pet class should also have the following methods:

setName-The setName method stores a value in the name field.

setType-The setType method stores a value in the type field.

setAge-The setAge method stores a value in the age field.

getName- The getName method returns the value of the name field

gettype- The getType method returns the value of the type field

getAge-The getAge method returns the value of the age field.

Once you have deigned the class, design a program that creates an object of the class and prompts the user to enter the name, type and age of his or her pet. This data should be stored in the object. Use the objects accessor methods to retrieve the pet's name, type, and age and display this data on the screen
Customer: replied 6 years ago.
Personal Information Class

Design a class that holds the following personal data:; name, address, age, and phone number. Write appropriate accessor and mutator methods. Also design a program that creates three instances of the class. One instance should hold your information and the other two should hold your firends or family members information
Expert:  Chris Parker replied 6 years ago.
HiCustomer

Thanks for the questions. Do you need pseudocode for Pet Class and Personal Information Class or an actual program written in say C++?

Let me know and I will get these out to you to tomorrow.

Regards,
Chris
Customer: replied 6 years ago.
Pseudocode please and I will deposit the money tomorrow morning. Thanks for your assistance.
Expert:  Chris Parker replied 6 years ago.
HiCustomer

Please find my response below.

Regards,
Chris

================================================================

1. Suppose myCar is the name of a class variable that references an object and go is the name of a method. (The go method does not take any arguments). Write a pseudocode statement that uses the myCar variable to call the method.


Class Car

Public Static Integer myCar

Public Module go()
Display "I'm in method go."
End Module

End Class

Integer Plant :: myCar

Module main()

Declare Car myCar
Set myCar = new Car()
Call myCar.go()

End Module

4. In pseudocode write the first line of the definition for a Poodle class. The class should extend the Dog class.

Class Poodle Extends Dog

5. Look at the following pseudocode class definitions

Class Plant
Public Module message()
Display "I'm a plant."
End Module
End Class
Class Tree Extends Plant
Public Module message()
Display "I'm a tree."
End Module
End class

Given these class definitions, what will the following pseudocode display?

Declare Plant p
Set p = new Tree()
Call p.message()


The pseudocode will display "I'm a plant."

1. Pet Class

Design a class named Pet, which should have the following fields:

name-The name field holds the name of a pet.
type-The type field holds the type of animal that a pet is. Example values are "Dog","Cat", and "Bird"
age-The age field holds the pet's age.

The Pet class should also have the following methods:

setName-The setName method stores a value in the name field.

setType-The setType method stores a value in the type field.

setAge-The setAge method stores a value in the age field.

getName- The getName method returns the value of the name field

gettype- The getType method returns the value of the type field

getAge-The getAge method returns the value of the age field.

Once you have deigned the class, design a program that creates an object of the class and prompts the user to enter the name, type and age of his or her pet. This data should be stored in the object. Use the objects accessor methods to retrieve the pet's name, type, and age and display this data on the screen


Class Pet

Private String name
Private String type
Private Integer age

Public Module setName ()
Display "Enter Name: "
Read name
End Module

Public Module setType ()
Display "Enter Type: "
Read type
End Module

Public Module setAge ()
Display "Enter Age: "
Read age
End Module

Public Module getName ()
return name
End Module

Public Module getType ()
return type
End Module

Public Module getAge ()
return age
End Module

End class

Module main()

String n
String t
Integer a

Declare Pet obj

obj. setName ()
obj. setType ()
obj. setAge ()

n= obj. getName ()
t= obj. getType ()
a= obj. getAge ()

Display "Name: " n
Display "Type: " t
Display "Age: " a

End Module

Personal Information Class

Design a class that holds the following personal data:; name, address, age, and phone number. Write appropriate accessor and mutator methods. Also design a program that creates three instances of the class. One instance should hold your information and the other two should hold your firends or family members information

Class Personal_Information

Private String name
Private String address
Private Integer age
Private Integer phone

Public Module setName ()
Display "Enter Name: "
Read name
End Module

Public Module setAddress ()
Display "Enter Address: "
Read address
End Module

Public Module setAge ()
Display "Enter Age: "
Read age
End Module

Public Module setPhone ()
Display "Enter Phone: "
Read phone
End Module

Public Module getName ()
Display "Name: " name
End Module

Public Module getAddress ()
Display "Address: " address
End Module

Public Module getAge ()
Display "Age: " age
End Module

Public Module getPhone ()
Display "Phone: " phone
End Module

End class

Module main()

Declare Personal_Information personal

Display “Enter Personal Details”

personal. setName ()
personal. setAddress ()
persoanal. setAge ()
persoanal. setPhone ()

Display “Enter Friends’ Details”

Declare Personal_Information friends

friends. setName ()
friends. setAddress ()
friends. setAge ()
friends. setPhone ()

Display “Enter Family Details”

Declare Personal_Information family

family. setName ()
family. setAddress ()
family. setAge ()
family. setPhone ()

Display “Personal Details”

personal. getName ()
personal. getAddress ()
personal. getAge ()
personal. getPhone ()

Display “Friends’ Details”

friends. getName ()
friends. getAddress ()
friends. getAge ()
friends. getPhone ()

Display “Family Details”

family. getName ()
family. getAddress ()
family. getAge ()
family. getPhone ()

End Module

=============================================================
Expert:  Chris Parker replied 6 years 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.

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