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

Project 1

Customer Guidelines The customer has given your manager the following guidelines for the system: Interfaces and startup: · The system needs to be GUI oriented and user friendly with functionality logically grouped together into sub-menus. · When program first starts it needs to give an option to open a new

GitHub

see attachment for details DAT 260 Module Eight Journal Guidelines and Rubric Overview As you have learned in the module resources, GitHub is more than just a place to store code. It is a dynamic community of practice and a living portfolio of your coding skills. In this journal entry,

Blockchain app programming

i have the template provided and you will have to use the term project presentation to complete it.  Secure-Trade CIS-5730 – Blockchain Applications TERM PROJECT PRESENTATION The money is stored in a digital wallet in the blockchain until two parties pass release or refund (Safe, 2026). The same agreement promotes

HIMS 655 ASS8

Watch the YouTube Video MEDICAL CODING ICD-10-CM GUIDELINES LESSON – 1.B – Coder explanation and examples for 2021 Review the ICD-10-CM Official Guidelines for Coding and Reporting at   and in your assignment respond to the following questions: Who is responsible for framing these Guidelines? Why are these guidelines necessary for

HIMS 645 ASS8

Using Internet resources, search  three national and three international healthcare organizations that maintain databases and use the information based on the processed data from these databases in their decision-making process. Briefly describe the organizations and types of data contained in their databases (make sure to remember quality of data points and

W8: Topic 1 – Course Wrap-Up

 Pick one topic from this class that most interested you. State the topic and your reasons for the choice. ii. You need to respond to at least 2 students.  This is part of your grade to be active in the threads and responding to students.   NB: THIS IS THE TOPIC

Big Data Tools and Emerging Technologies

please see attachment  4 [ Note: To complete this template, replace the bracketed text with your own content. Remove this note before you submit your project.] Big Data Tools and Emerging Technologies Paper [Your Name] DAT 260: Emerging Technologies and Big Data [Your Instructor’s Name] [Date—for example, May 1, 2021]

HIMS 655 ASS7

Mapping between SNOMED-CT and ICD-10-CM Note: For completing this assignment, use of the I-MAGIC tool (Interactive Map-Assisted Generation of ICD Codes) is required. To access the I-MAGIC tool, click on the following  ) Problems and diagnoses can be recorded in SNOMED CT in the EHR, while the cross-mappings to ICD-10-CM can

HIMS 645 ASS7

Four types of databases are Relational, Network, Hierarchical, and Object-Oriented. What are their salient features (a table format is acceptable)? Assess their usability for healthcare facilities that generated numerical, text, and images data citing reasons for your choice.  Two most commonly used databases in healthcare organizations are Relational and Object-Oriented (O-O). Both employ respective

MS ACCESS

Need to do a Microsoft Access document for my work.  2 Consideration of MS Access Database Development on Healthcare. Name Instructor School Date Consideration of MS Access Database Development on Healthcare. Introduction The task entailed developing a Microsoft access database of a small healthcare facility, which has just abandoned the

Effective security programs

Organizational policies define the direction for an organization and contribute to its overall security culture by setting the tone on what is and is not acceptable. 

The Equifax Data Breach

Briefly explain what the Equifax data breach was, why it happened, and why it was important. You should mention that Equifax failed to protect personal data, discuss the ethical and security issues involved, and explain what companies can learn from the incident. Please see attached documents.