CCIT4020: Introduction to Computer Programming Assignment

Download Solution Order New Solution

Long Question

Penalties

A penalty will be applied for the following cases:

  • Student Name or Student ID is missing

  • Comments are insufficient

  • Filename must be exactly A1Q1.py (case-sensitive). For non-matching names (e.g., a1q1.py, A1Q1 .py, A1Q1.PY, or with extra prefixes/suffixes), the score for this question will be multiplied by 0.7 (i.e., only 70% of the earned score will be awarded)

Task Overview

Write a Python program to solve the business problem as described below and save your code in A1Q1.py.

You are required to include your student name and student ID at the top of the python file. Comment your code to demonstrate your understanding.

Business Problem

Linda owns a small fruit stand named “Happy Fruit World” at 10 Main Street, Baltimore, Maryland. She would like to create a flyer showcasing all the fruits she sells. Her goal is to distribute this flyer to attract more customers to visit her stand.

The prices for fruits are listed below:

  • Apple – 1.29 USD/kg

  • Pear – 8.59 USD/kg

  • Orange – 4.99 USD/kg

  • Coconut – 5.29 USD/kg

  • Watermelon – 3.2 USD/kg

This flyer may need to be updated periodically to reflect changes in the stand name, fruit selection, prices, or advertising slogans. Therefore, you are required to develop a flyer generator tool that can dynamically produce the flyer based on the specifications.

Output Layout

  • Figure 1: Output layout for the flyer generator tool

  • Figure 2: Sample Output

Figure 1 and Figure 2 show the output layout for the flyer generator tool and the sample output respectively. The following steps will guide you to complete the task.

Steps to Complete the Task

  1. Create variables to store the following information:

    • The name of the fruit stand

    • The advertising slogan

    • The stand address

    • A decorative dotted line
      Initialize each variable with the provided values.

  2. For any repeated values (e.g., "****" or "USD/kg"), store them in separate variables to avoid redundancy.

  3. Define two list variables: one for the fruit names and another for their corresponding prices. Initialize each list with the values provided above, maintaining the listed order. The data type for fruit names should be string, while price values should be represented as float.

  4. Use the sep argument in the print() function with " @ " as its value, making sure there is a space before and after the @ symbol.

  5. Format all prices to display two decimal places using f-strings.

  6. When displaying list elements, access them directly by index. Do not use loops or iterations.

Summary of Assessment Requirements

The Long Question [10 marks] requires students to create a Python program that generates a flyer for a small fruit stand called “Happy Fruit World”. The assessment focuses on developing programming skills, proper code documentation, and understanding of Python fundamentals.

Key requirements include:

  • Penalties:

    • Missing student name or ID

    • Insufficient comments

    • Incorrect filename (must be A1Q1.py, case-sensitive; otherwise, only 70% of earned marks)

  • Task Overview:

    • Write a Python program to dynamically generate a flyer based on the provided business problem.

    • Include student name and student ID at the top of the file.

    • Use comments to demonstrate understanding.

  • Business Problem:

    • Create a flyer for Linda’s fruit stand to showcase her fruits and prices:

      • Apple – 1.29 USD/kg

      • Pear – 8.59 USD/kg

      • Orange – 4.99 USD/kg

      • Coconut – 5.29 USD/kg

      • Watermelon – 3.20 USD/kg

    • The flyer should allow updates for stand name, prices, or advertising slogans.

  • Program Requirements:

    1. Create variables for stand name, slogan, address, and decorative dotted line.

    2. Store repeated values (e.g., "****" or "USD/kg") in separate variables to reduce redundancy.

    3. Define two lists: one for fruit names (string) and one for prices (float), preserving order.

    4. Format prices to two decimal places using f-strings.

    5. Access list elements directly by index, without loops.

Approach by the Academic Mentor

The Academic Mentor guided the student through the assessment step by step to ensure all requirements were met while developing programming competency.

Step 1: Understanding the Requirements

  • The mentor explained the business problem, emphasizing the need for a dynamic flyer generator.

  • The student was briefed on penalties and the importance of including their name, ID, and comments.

  • The mentor clarified the expected output layout and sample outputs.

Step 2: Planning the Program

  • The mentor guided the student to break the task into components:

    1. Variables for stand name, slogan, address, and decorative line.

    2. Separate variables for repeated values like "****" or "USD/kg".

    3. Two lists for fruit names and prices.

  • A flowchart or pseudocode approach was suggested to visualize the program structure before coding.

Step 3: Writing the Code

  • The student wrote the Python program in following these directions:

    • Declared all required variables and lists.

    • Used direct indexing to display fruit names and prices.

    • Applied function for output formatting.

    • Formatted prices with f-strings to show two decimal places.

    • Added comments to explain each section, demonstrating understanding.

Step 4: Testing and Validation

  • The mentor encouraged the student to run the program multiple times to ensure correct formatting and accuracy of prices.

  • Output was compared with the sample flyer layout to verify correctness.

  • Minor errors (spacing, formatting, variable names) were corrected with mentor feedback.

Outcome of the Assessment

  • The student successfully created a dynamic flyer generator that:

    • Displays fruit names and prices formatted to two decimal places

    • Uses the argument as specified

    • Avoids loops and accesses list elements directly

    • Includes all required variables, comments, and student details

  • The program is readable, maintainable, and meets the assessment criteria.

Learning Objectives Covered

Through this assessment, the student achieved the following:

  1. Understanding of Python basics: variables, lists, data types, and formatting.

  2. Code readability and documentation: proper comments and variable usage.

  3. Practical problem-solving: translating a business scenario into a working program.

  4. Output formatting: using  and f-strings for professional presentation.

  5. Attention to detail: following naming conventions, file requirements, and output specifications.

Boost Your Understanding with This Sample Solution

Looking for guidance on your assignment? This sample solution is a great reference to help you understand the structure, formatting, and approach needed for high-quality work. Use it to improve your learning, plan your own answers, and gain confidence in tackling similar tasks.

Important: This sample is provided for reference only. Submitting it as your own work may result in plagiarism and academic penalties. Always ensure your final submission is your own original work.

If you want a fully customized, plagiarism-free assignment, our professional academic writers are ready to help. Ordering a fresh solution gives you:

  • 100% original content tailored to your assignment instructions

  • Expertly formatted, research-backed answers

  • On-time delivery with full confidentiality

  • Support from qualified subject specialists

Don’t risk your grades—get the professional guidance you need while learning effectively.

Take action now:

Download Sample Solution                          Order Fresh Assignment

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.