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

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. 

Reflection on Big Data and AI

please see attached DAT 260 Module Five Journal Guidelines and Rubric Overview In this journal assignment, you will reflect on key concepts covered in this module. This assignment directly supports your work in Project Two, which is due in Module Seven. Directions In a well-crafted journal entry, address the following:

Disaster Recovery

  Questions: Research the network and server outage problems experienced during a previous man-made or natural disaster and answer the following questions: What parts of the infrastructure was impacted? How were the networks recovered? How redundancy could have mitigated the impact of the disaster?

Network Design and Plan Purpose

Please review attachment Mod 4 Project: Network Design and Plan Purpose In this module, we will introduce a course design project that will be completed in four parts during the course. This project provides you an opportunity to solve a comprehensive problem in firewall and virtual private network (VPN) implementation

Memecoins & Stablecoins Development

Please take a look at the attachment. Lab #3: Blockchain-Based Ecosystems: Memecoins & Stablecoins Development, Attack Simulation, and Auditing Lastname: ______________ First name:____________Date_______ TA_Prove_ Yes/No 1. Overview This lab guides students through designing, implementing, deploying, testing, and auditing a simple memecoin (ERC‑20) and a minimal ecosystem around it (liquidity pool,

Blockchain Presentation

presentation about a blockchain Term Project CIS 5730- Blockchain Application Project Guideline Part ii–Presentation Along with the project you will present what you did to the class in a short presentation. If you want, you can demonstrate the project, or just present an overview of what you did. Presentations should

Network Threats

  Questions: Below is a list of common network attacks: Distributed Denial of Service (DDoS) DNS poisoning ARP poisoning Domain hijacking MAC flooding MAC cloning Man-in-the-Middle Explain two of these network attacks and discuss methods/techniques for protecting the network against them.

Best Practices for Role-Based Privilege Management in Databases

  Research the best practices for managing and securing role-based privileges in databases and address the following questions in your discussion post:  What are the key challenges in managing role-based privileges, and how do they impact database security? Can you provide a real-world scenario where poor role-based privilege management led

Computer Science Cloud Computing assignment

Please see attachment for details 4 [ Note: To complete this template, replace the bracketed text with your own content. Remove this note before you submit your paper.] Cloud Computing Evaluation Paper 1 Cloud Computing [Differentiate between cloud computing models and their uses. What are the different types of deployment