Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

Computer Science – Machine Learning Python Programming Assignment

Assignment Help. Please don’t forget to add comments in the code

Page 1 of 3 NorQuest College – CMPT 1011: Lab Assignment 5

CMPT 1011: Introduction to Computing

Lab Assignment 2: Variables, mathematical
operations and data types

Value

This coding challenge is worth 3% of your final grade.

Background

In this coding challenge you will be using variables to calculate and print the correct output.

This assignment relates to the following General Learning Outcomes:

1. Explain fundamental concepts in computing science

2. Examine different data types and manipulating variables

Instructions

1. Use Intellij Idea write your code and make sure it works for couple of examples.

Problem statement: Shopping calculator

A shopkeeper sells apples at 3$/unit, bananas at 1.8$/unit and oranges at 2.5$/unit. He

usually sells 20 apples, 50 bananas and 35 oranges per day. However, due to extreme

snowy conditions, he’s offering special discounts:

• Apples: 10% off,

• Bananas: 15% off clearance sale,

• Oranges: 10 for 22$.

Now, a customer arrives on a snowy day and wants to buy X apples, Y oranges and Z

bananas.

Your task is to calculate and print the following:

1. Revenue from the Customer:

• Ask for the number of apples (X), oranges (Y) and bananas (Z) bought. For

example: “How many oranges? <Y>” and “How many bananas? <Z>”

• Calculate the total cost for the customer, factoring in all discounts.

Page 2 of 3 NorQuest College – CMPT 1011: Lab Assignment 2

• Print: “The shopkeeper sold X apples, Y oranges and Z bananas to the customer for

a total of $<M>.” Where <M> is your total calculated price.

2. Usual daily revenue:

• Calculate and print the shopkeeper’s usual daily revenue based on the standard

pricing.

• Print: “Usually, the shopkeeper makes ‘$’.” Where ‘$’ should have your calculated

total revenue for X apples, Y bananas and Z oranges.

Suggestions:

• You are to solve the problem by declaring variables containing each fruit unit price.

For example, apples_price = 3, bananas_price = 1.8 etc. You will also have

different variable storing each fruits’ discounted price for snowy days, e.g.

discounted_apples_price = 0.9* apples_price.

• When asking for user inputs, use descriptive variable names and correct casting to

type as needed. For example:

num_apples = float(input(“How many apples? “))

• Use clear variable names when calculating total revenue for the customer and the

usual daily revenue. For example, total_customer_revenue, total_usual_revenue

etc.

• In print statements, practice concatenating variable values using f-strings, the “+”

or “,” operator. Example of f-strings:

print(f”The shopkeeper sold {num_apples} apples,

{num_oranges} oranges and {num_bananas} bananas to the

customer for a total of ${total_customer_revenue}.”)

2. Submit your “<FirstName>_<LastName>_Lab2.py” file to the Moodle assignment box.

3. Deadlines will be announced in Moodle. Consider this assignment your opportunity to

integrate what you’ve learned throughout the course.

4. You will be assessed using the rubric provided.

Page 3 of 3 NorQuest College – CMPT 1011: Lab Assignment 2

Assignment Rubric (Total: __/12 marks)

5 3 2 1

Does Not

Meet

Expectations

0

Print

statements

and input

function usage

All the print

statements

are

correctly

showing the

values and

input

function

used

properly

1 or few

print

statements

missing. 1

or few

inputs not

taken.

A few

messages not

displayed, and

input function

not correctly

used.

Both print

statements

and input

function not

used correctly.

No evidence

Variable

naming and

Type casting

All variable

names

sensible

and

correctly

casted to

types as

required

Some

variable

names

sensible

and

correctly

casted to

types as

required

Variable

names are not

clear

Variable

names not

clear and type

casting not

done correctly

No evidence

Filename and

documentation

Good

documentation

in code and

correct

filename

Either

documentation

or filename

not correct

No evidence

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Public safety Communications

Subscribe The Communications and Cyber Resiliency Toolkit provides guidance for establishing resiliency measures, public safety communications can better withstand potential disruptions to service. This toolkit, developed by CISA, describes networks and systems critical to successful communication and cyber resiliency and possible threats while providing many resources and additional links for

Case Study 4 o Data (computer)

Follow the attached instructions to complete this work Unit 4 Case Study Directions Review the following case study. Consider both the big-picture ideas and the specific concerns. Make use of the key terms and concepts from the readings in your written responses to the questions below. The case study paper

Discussion 5 and 6

Follow  the attached instructions to complete this work Unit 5 Discussion   Overview In this discussion, you will be considering the emphasis on aspects such as privacy and safety. You will reflect on the significance of the legal concerns and goals of public-private partnerships to address cybersecurity. You will also

SQL injection

Hey! ????  I need an expert in SQL injection, DDOS attack, Code injection attack, XSS attack! To talk further please contact me on discord at mara411 so we can talk more freely and then I will hire you on here! Thanks ???? 

Free CAD, FeniCS or paraview

I have attached the picture and sample work too, I need work as like sampl, but not the copypasted Make sure you can ask me multiple questions but not dont do rubbish work

database

2. Final Assignment – equivalent to 4,000 words The final module mark is based on two deliverables focused on the CarNow case study described below. – 50% of the final mark a. An advisory report – 50 % of the final mark Includes 5% (of the module grade) given for

Computer

Documentation Tabula Insurance Agency ENTER AND UPDATE COMPANY DATA Author: Ashanti Joyner Note: Do not edit this sheet. If your name does not appear in cell B6, please download a new copy of the file from the SAM website. Personnel Tabula Insurance Agency Personnel: April 4-10, 2024 Employee Name Salary

Computer class

All information is below Toronto converted a declining part of the city into a vibrant neighborhood using the smart city 1.0 approach when a local technology company introduced electric shuttle buses to replace private cars and intelligent traffic lights to regulate the flow of pedestrians, bicycles, and vehicles. From Frankl,

Week 15

Read attachments for assignments  Week 14 Feedback Overall Feedback Well done on this assignment You will have to refine your tables and figures for your final submission. Always introduce them to the reader in preceding paragraph, properly create APA table, and cite figures. See Video:   APA Tables and Figures

Prof Double R

  PowerPoint Presentation: Narrative Presentation to the Board of Trustees The Centers for Medicare & Medicaid Services (CMS) has taken on a more visible role in health care. A great deal of change has transpired to improve patient safety and implementation of additional quality metrics. The new health care reform

Week 14

Please read attachments for details  image1.png

Week 13

Read attachments for details  The Finishing Touches – Week 13 Instructions For this week’s assignment you will submit the material discussed in the lesson plan and summarized below: · A refined introduction (Mandatory) · Updated Title Page (Mandatory) · Copyright Page with Declaration (Mandatory) · Dedication Page (Optional) · Acknowledgement

SCMT699

please read attachments for assignment  Feedback from week 10 Please address your design before your next submission.  Its how you are going to go about conducting your research so other can duplicate it. This is a good book on it. Creswell, J. W. (2009). Research design: Qualitative, quantitative, and mixed

Discussion 2

Follow the attached instructions to complete this work. Using ChatGPT or another generative AI tool, you will request SQL code for a business problem using simple user requirement terms. Then you will plug that into MySQL to reverse engineer an ERD. You and your classmates will discuss misalignments between what

Week 10

Read attachment for details  Week 8 Feedback Overall Feedback Theory is one of the most difficult concept to grasp.  Your study must be based on a theory and align with what you are attempting to explore and what you are trying to answer based on previous gaps in research. Well

hw2

This problem exercises the basic concepts of game playing, using tic-tac-toe as an example.  We define Xn as the number of rows, columns, or diagonals with exactly n X’s and no O’s.  Similarly, On is the number of rows, columns, or diagonals with exactly n O’s.  The utility function assigns

Computer Science Homework 2

Homework 2. Question 1. Decision Tree Classifier [10 Points] Data: The zip file “ hw2.q1.data.zip” contains 3 CSV files: · “ hw2.q1.train.csv” contains 10,000 rows and 26 columns. The first column ‘ y’ is the output variable with 2 classes: 0, 1. The remaining 25 columns contain input features: x_1,