Just whats left of my assighnments for a beginner pseudocode class i

[ad_1]

 

 

 

Chapter 8

 

Exercise

1.       Design an application that accepts 10 numbers and displays them in descending order.

 

 

4. The village of Ringwood conducted a census and created records that contain household data, including income. Ringwood has exactly 75 households. Write a program into which a village statistician can enter each of the 75 household income values, and determine the mean and median house-hold income.

 

13. Your student disk contains fi les named DEBUG08- 01. txt, DEBUG08- 02. txt, and DEBUG08- 03. txt. Each fi le starts with some comments that describe the problem. Comments are lines that begin with two slashes (//). Following the comments, each fi le contains pseudocode that has one or more bugs you must fi nd and correct.

08-01

// This application reads 10 numbers

// and sorts them, and displays the three highest numbers

start

   Declarations

      num SIZE = 10

      num number

      num numbers[SIZE]

      num count

   getReady()

   while count < SIZE

      detailLoop()

   endwhile

   finish()

stop

 getReady()

   output “Enter a number “

   input number

return

 

detailLoop()

   numbers[SIZE] = number

   count = count + 1

   output “Enter a number “

   input number

return

 

finish()

   sort()

   output “The highest three are “, numbers[0], numbers[0], numbers[0]

return

 

sort()

   num x = 0

   num y = 0

   num COMPS = count – 1

   while y < COMPS

      x = 0

      while x < COMPS

         if numbers[x] < numbers[x + 1] then

            swap()

         endif

         x = x + 1

      endwhile

      y = y + 1

   endwhile

return

 

swap()

   num temp

   temp = numbers[x + 1]

   numbers[x + 1] = numbers[x]

   numbers[x] = temp

return

 

08-02

 

// This application reads student typing test data

// including number of errors on the test, and the number

// of words typed per minute. Grades are assigned based

// on the following table:

//           Errors      

// Speed       0       1    2 or more

// 0–30        C       D       F

// 31–50       C       C       F       

// 51–80       B       C       D

// 81–100      A       B       C

// 101 and up  A       A       B

start

   Declarations

      num MAX_ERRORS = 2

      num errors

      num wordsPerMinute

      num grades[5][3] = {“C”, “D”, “F”},

                         {“C”, “C”, “F”},

                         {“B”, “C”, “D”},

                         {“A”, “B”, “C”},

                         {“A”, “A”, “B”}

      num LIMITS = 5

      num speedLimits[LIMITS] = 0, 31, 51, 81, 101

      num row

   output “Enter number of errors on the test “

   input errors

   if errors = MAX_ERRORS then

      errors > MAX_ERRORS

   endif

   output “Enter the speed in words per minute “

   input wordsPerMinute

   while row < LIMITS AND wordsPerMinute >= speedLimits[row]

      row = row + 1

   endwhile

   row = row – 1

   output “Your grade is “, grades[errors][row]

stop

 

08-03

This application reads sales data for an automobile dealership.

// Up to 100 sale amounts can be entered. The entered sale amounts

// are sorted so the median sale can be displayed.

start

   Declarations

      num SIZE = 100

      num QUIT = 99999

      num saleAmount

      num sales[SIZE]

      num count = 0

      num middlePosition

      num x

      num y

      num temp

      num comps

   getReady()

   while saleAmount count < SIZE

      detailLoop()

   endwhile

   finish()

stop

 

getReady()

   output “Enter sale amount “

   input saleAmount

return

 

detailLoop()

   sales[x] = saleAmount

   count = count + 10

   output “Enter sale amount “

   input saleAmount

return

 

finish()

   sort()

   middlePosition = count * 2

   output “The median sale amount is “, sales[middlePosition]

return

 

sort()

   comps = count – 1

   while y < comps

      x = 0

      while x < y

         if sales[x] > sales[x + 1] then

            swap()

         endif

         x = x + 1

      endwhile

      y = y + 1

   endwhile

return

 

void swap()

   temp = sales[x]

   sales[x + 1] = sales[x]

   sales[x] = temp

return

Complete Chapter 10: Exercise 1, 2, 3, 6, 11

 

 

 Exercises 1,2,3,6

1. Identify three objects that might belong to each of the following classes: a. Automobile b. Novel Author c. College Course

 

2. Identify three different classes that might contain each of these objects: a. Wolfgang Amadeus Mozart b. My pet cat named Socks c. Apartment 14 at 101 Main Street

 

3. Design a class named Customer Record that holds a customer number, name, and address. Include methods to set the values for each data field and display the values for each data field. Create the class diagram and write the pseudocode that defines the class.

 

6. Complete the following tasks: a. Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to set and get the values for each data fi eld. Create the class diagram and write the pseudocode that defi nes the class. b. Design an application that declares two Book objects and sets and displays their values. c. Design an application that declares an array of 10 Books. Prompt the user for data for each of the Books, then display all the values.

 

 

 

 

Chapter 9

Exercises 2, 5, 6

 

2.       Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills; in other words, the method calculates the number of 20s, 10s, 5s, and 1s needed.

 

 

 5. a. Create the logic for a program that performs arithmetic functions. Design the program to contain two numeric variables, and prompt the user for values for the variables. Pass both variables to methods named sum() and difference(). Create the logic for the methods sum() and difference(); they compute the sum of and diff erence between the values of two arguments, respectively. Each method should perform the appropriate computation and display the results. b. Add a method named product() to the program in Exercise 5a. Th e product() method should compute the result when multiplying two numbers, but not display the answer. Instead, it should return the answer to the calling program, which displays the answer.

 

6. Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. Th e application passes the value in turn to a method that squares the number and to a method that cubes the number. The program displays the results before reprompting the user. Create the two methods that square and cube a number passed to them, and then return the calculated value.

 

 

Exercise 8, 12,

 

8. Create the logic for a program that continuously prompts the user for two numeric values that represent the sides of a rectangle. Include two overloaded methods that compute a rectangle’s area. One method takes two numeric parameters and calculates the area by multiplying the parameters. Th e other takes a single numeric parameter, which is squared to • If both numbers entered are greater than 0, call the method version that accepts two parameters and pass it both values. • If one of the values entered is 0 but the other is not, call the version of the method that accepts just one parameter and pass it the nonzero value. • If both the entered values are 0, display an error message. • If both numbers entered are greater than 0, call the method version that accepts two parameters and pass it both values. • If one of the values entered is 0 but the other is not, call the version of the method that accepts just one parameter and pass it the nonzero value. • If both the entered values are 0, display an error message.

 

 12. Create the logic for a program that prompts a user for three numbers and stores them in an array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the main program.

 

Exercise 6,

 

 6. Complete the following tasks: a. Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each of the Book’s data fields with explanations. b. Design a class named Text Book that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class displayInfo() method so that you accommodate the new grade- level fi eld. c. Design an application that instantiates an object of each type and demonstrates all the methods.

 

Ch 11 Exercise 1, 2a, b Exercise 6, 17

 

1.       Complete the following tasks: a. Design a class named Circle with fields named radius, area, and diameter. Include a constructor that sets the radius to 1. Include get methods for each field, but include a set method only for the radius. When the radius is set, do not allow it to be zero or a negative number. When the radius is set, calculate the diameter ( twice the radius) and the area ( the radius squared times pi, which is approximately 3.14). Create the class diagram and write the pseudocode that defines the class.

2.       2. Complete the following tasks: a. Design a class named Square with fields that hold the length of a side, the length of the perimeter, and the area. Include a constructor that sets the length of a side to 1. Include get methods for each field, but include a set method only for the length of a side, and do not allow a side to be zero or negative. When the side is set, calculate the perimeter length ( four times the side length) and the area ( a side squared). Create the class diagram and write the pseudocode that defines the class.

b. Design an application that declares two Squares. Set the side length of one manually, but allow the other to use the default value supplied by the constructor. Then, display each Square’s values.

 

6. Complete the following tasks: a. Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each of the Book’s data fields with explanations.

b. Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class displayInfo() method so that you accommodate the new grade- level field.

c. Design an application that instantiates an object of each type and demonstrates all the methods

 

Ch 12 Exercises 1, 2, 4, 10

1.       Take a critical look at three GUI applications with which you are familiar— for example, a spreadsheet, a word- processing program, and a game. Describe how well each conforms to the GUI design guidelines listed in this chapter.

 

2.Select one element of poor GUI design in a program with which you are familiar. Describe how you would improve the design.

 

4. Design the storyboards, interactivity diagram, object dictionary, and any necessary scripts for an interactive program for customers of Sunflower Floral Designs. Allow customers the option of choosing a fl oral arrangement ($ 25 base price), cut fl owners ($ 15 base price), or a corsage ($ 10 base price). Let the customer choose roses, daisies, chry-santhemums, or irises as the dominant flower. If the customer chooses roses, add $5 to the base price. After the customer clicks an Order Now button, display the price of the order.

 

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Australia Assessments
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Project Management
I gave a lower rating on the service because, a notification from the support team went out but it did not come to my email address. Had I not looked earlier on the website, then I would have been penalized for not turning in my paper on time. On my profile, I have a phone# and I also have an email address. Please set up a system to text or email new messages or notifications from the writer or support team. This will ensure that the order is processed in a timely manner. With the new and upcoming technology, this seems like it should be an easy fix to have a tool built in the website to email or text notifications of changes to orders. This is no reflection to the support team. I see this as a system issue and not a support team issue.
Customer 463323, September 26th, 2022
Social Work and Human Services
Good work.
Customer 462793, July 8th, 2022
Human Resources Management (HRM)
It's great. I recommend the writer.
Customer 454223, April 9th, 2020
Business and administrative studies
Good work.
Customer 452615, May 9th, 2022
Nursing
Thank you so much for the great paper!
Customer 454007, May 31st, 2020
English 101
Thank You!
Customer 454425, June 21st, 2020
Other
Good calculations.
Customer 462613, April 21st, 2022
SEO
Very nice content. I am glad you took the corrections to heart and made the changes. Commendable work.
Customer 463679, February 22nd, 2023
Business
WORK WELL DONE!
Customer 463463, November 1st, 2022
Business and administrative studies
As I expected.
Customer 460551, December 15th, 2021
Business and administrative studies
Good work,
Customer 462901, April 27th, 2022
Retail
Good
Customer 463469, October 18th, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat