• 0

Homework Help


Question

PROBLEM:

A portrait studio charges its customers for portrait sitting based on the number of subjects posing for the portrait. The fee schedule is as follows:

Subjects in

potrait Base price

1 $100

2 $130

3 $150

4 $165

5 $180

6 $190

7 or more $200

Write a pseudocosde for the following:

A program that accepts the following data continuously until EOF: the last name of the family sitting for the portrait, the number of subjects in the portrait, the schedule day of the week, and the scheduled time of day. Declare appropriate variables and constants with matching data types. Include proper input statements. Display the above data and calculated sitting fee only for a sitting schedule on Thursday after 1:00p.m. or Friday before noon.

MY Code:

"String (Family_Name) = A

String (Subjects_in_Portrait) = B

String (Day_of_Week) = C

String (Apt_Time) = D

String (Base_Price) = P

Start

Get A, B, C, D

IF B = 1, THEN

P = $100.00

ELSE IF B =2, THEN

P = $130.00

ELSE IF B=3, THEN

P=$150.00

ELSE IF B=4, THEN

P=$165.00

ELSE IF B=5, THEN

P=$180.00

ELSE IF B=6, THEN

P=$190.00

ELSE IF B >=7, THEN

P=$200.00

END IF

RETURN A, B, C, D, P

Stop"

Please help with corrections or advice, this is one of the early assignments, I am looking through the chapters for help but figured you guys could add to it. Where does EOF fit in? What does the time of day have to do with?

Link to comment
https://www.neowin.net/forum/topic/678254-homework-help/
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Write a pseudocosde for the following:

A program that accepts the following data continuously until EOF: the last name of the family sitting for the portrait, the number of subjects in the portrait, the schedule day of the week, and the scheduled time of day. Declare appropriate variables and constants with matching data types. Include proper input statements. Display the above data and calculated sitting fee only for a sitting schedule on Thursday after 1:00p.m. or Friday before noon.

What you're being asked for isn't pseudocode but a functional program that can be translated to the language of choice. Pseudocode is a human-understandable series of declarative statements that follow a program flow as if you were reading a flow chart out loud.

However, back to the question:

It appears that the data is to be assumed to be in a on-line-per-record style (CSV), so a loop is to be set up iterating over each line until EOF (no more lines) and performing the computations for each line:

Smith,4,Thursday,15:00
Jones,2,Tuesday,09:30
...

What does the time of day have to do with?

Perhaps it means to look through the dataset filtering on the date / time and showing the prices. in other words, build in filtering functionality to limit the dataset.

Link to comment
https://www.neowin.net/forum/topic/678254-homework-help/#findComment-589921462
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.