• 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.
  • Posts

    • PDF Shaper 15.6 by Razvan Serea PDF Shaper is a set of feature-rich PDF software that makes it simple to split, merge, watermark, sign, optimize, convert, encrypt and decrypt your PDF documents, also delete and move pages, extract text and images. The program is optimized for low CPU resource usage and operates in batch mode, allowing users to process multiple PDF files while doing other work on their computers. PDF Shaper is available in three editions - Free, Premium and Ultimate. Compare and pick edition which is suitable for you. Compatible with Windows 7, 8, 10, 11. Features: Convert PDFs to Word, text, or image files (and vice versa) Merge, split, and watermark documents with precision Insert, move, delete, rotate and crop pages/ranges Rename and organize PDF collections efficiently Encrypt with advanced AES password protection Apply multiple digital signatures for documents Extract text, images, or complete pages from any PDF Benefits: Easy-to-use, intuitive user interface Low CPU resource usage during any process, including conversion Free for personal use and for any non-commercial organization Supports Unicode characters Supports batch processing for any operation Small installation size PDF Shaper 15.6 changelog: Improved overall program performance. Improved image rendering in all tools. Improved XMP information extraction. Improved compatibility with ARM64 systems. Improved DOC to PDF conversion: Improved support for font files. Improved support for picture cropping. Improved support for list formatting. Improved support for text line spacing. Download: PDF Shaper 15.6 | 8.0 MB (Free for personal use only) Link: PDF Shaper Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Yeah, this is absolutely nothing new and EA have done it before. Burnout Paradise, released in 2008, had dynamic advertising billboards that were updated via the internet and targeted people based on location and what EA knew about them from their profile. It was particularly notable for the fact that the Obama presidential campaign ran ads in the game, in an attempt to reach a younger audience who didn't watch broadcast TV any more. It was by no means the first though. Battlefield 2142 from 2006 had the same thing. In fact, Neowin wrote a story about it back then. https://www.neowin.net/news/ba...-in-game-ads-clarification/
    • This is obviously aimed at the education where Apple has lost so much ground to Chromebooks in the last few years, but unless they come up with a comparable management system for education why would anyone switch back?
    • Here's how we arrived at that claim: Note that this is just Play Store downloads. The app is also available on the Galaxy App Store
    • Google Play states the app had more than 50 million downloads. What other metric do you suggest should be used?
  • Recent Achievements

    • One Year In
      Console General earned a badge
      One Year In
    • One Year In
      Twozo Technologies earned a badge
      One Year In
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
    • Veteran
      branfont went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      531
    2. 2
      +Edouard
      206
    3. 3
      PsYcHoKiLLa
      130
    4. 4
      Steven P.
      90
    5. 5
      neufuse
      74
  • Tell a friend

    Love Neowin? Tell a friend!