Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Name: ______Mashroor________________

Date:___________Sharif______________

Coding with Scratch


Solving Linear Equations
STEPS:
1) Go to https://scratch.mit.edu
Create an account on Scratch.
Click join Scratch if you do not have an account. Click sign-in if you have an account.
Confirm account using email.
2) If you are using Scratch for the first time, click on ‘Learn how to make a project in
Scratch’ under the ‘Welcome to Scratch’ tab.

3) Create a new program by clicking Create at the top of the screen.

4) Create a copy of this document and answer the questions on this document.
5) Make sure to save your work as you are working through the assignment.

6) Share the link directly with me by clicking share and copying the link onto this
document.
7) Submit all work on Brightspace by Thursday, October 19, 2023 @ 11: 59 p.m.

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

In this task you will create a code that will solve a linear equation. The user of the code will enter the
value of the coefficients and constant terms and the code will calculate the value of x.

Part A
1. Choose ONE of the equations below.

Novice Task: Beginner or Proficient Task:


(one-step equations) (multi-step equations)

Write your chosen equation here: ______E. a(x+b)=c____________

2. Using your chosen equation, solve the equation for x


Rearrange the equation for x. Describe the steps to rearrange the equation using proper terminology
Equation to be arranged and work Explanation in words with proper terminology
[complete this on paper if you prefer] [complete this on paper if you prefer]

a(x+b)=c a(x+b)=c

a*x+a*b=c Since a is multiplying to x+2, If we opened the


bracket it would be ax+ab=c, after this you
c-a*b=a*x would proceed to like terms, c-ab=ax, so on
you continue with algebra

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

3. Create a program that will solve any equation of that form.


○ Input: ask the user for the value of a,b and c if needed.
○ Output: display the value of x.
○ Proficient Task Only: If division by zero occurs, code displays an error message.

Link to your Scratch program


https://scratch.mit.edu/projects/910229942/
https://replit.com/@mashroorsharif/Math-coding-assignment-Mashroor?v=1
For any confusion here is my code for the replit

question = input("Hello today I will be doing an explanation and answering of


a(x+b)=c If you would like to solve the equation Press 1, If you would like to get an
explanation Press 2.")

if question == ("1"):
a = float(input("What is your a?"))
b = float(input("What is your b?"))
c = float(input("What is your c?"))
b2 = (a*b)
x = (a*1)

c2 = (c-b2)
c3 = (c2/x)

print(c3)

if question == ("2"):
print(" a(x+b)=c Since a is multiplying to x+2, If we opened the bracket it
would be ax+ab=c, after this you would proceed to like terms, c-ab=ax, so on")

Give your Scratch program a title, click on “share”, then “Copy Link”. Paste the link in the box above.

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

Ask the user for the value of a,b and c if needed and display the value of x. Take extra care when
entering the formula to make sure the order of operation is followed.

Starting an event

State what the code is going to do

Ask user for value of coefficients and


constants

Assign answer to a variable

Solve for the unknown

State the solution

4. Test Case - Verify that the code works correctly


i) Give values to the parameters a, b and c (if needed) in your original equation and solve the
equation by hand by isolating the unknown using opposite operations.

Your Original Equation: _______a(x+b)=c ax+ab=c, c-ab=ax_____________

a = _2___, b = _-3___ and c =___5_ (At least one of the values should be negative)
Substitute the values a, b and c into the equation and solve for x:

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

2(x+-3)=5

2x+-6=5

5-(-6)=11

11/2= 5.5

ii) Verify the solution using Left Side (L.S) / Right Side (R.S.) check

LS RS

2(5.5+(-3))
11+(-6) 5

iii) Use your code to solve the equation from part i). Share a screenshot of the answer you got
from the code in the digital copy of this document.
❏ Attach a screenshot of the solution your code gives here. Screenshot:​​Press Shift + Ctrl + Show windows

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

5. Proficient Task Only: Test your code with the following values:
𝑎= 0 𝑏 = 1 𝑐 = 2

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________
a) What is the answer given by your code? Include a screenshot of the output here: Error.

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________
b) Substitute the values 𝑎 = 0 𝑏 = 1 𝑐 = 2 into the equation and solve for x by hand if
possible. If not possible, explain why? [complete this on paper if you prefer]

0(x+1)=2
2/0 = undefined

©2020 Angjeli
Name: ______Mashroor________________
Date:___________Sharif______________

Rubric
Proficient Task Selected ------------------------------------------------------------------------------------------------------------------------------------>
Beginner Task Selected ---------------------------------------------------------------------------------------------->
Novice Task Selected -------------------------------------------------------------------->
Marking Rubric Developing Level 1 Level 2 Level 3 Level 4
0 to 5 marks 6 marks 8 marks 10 marks 12 marks
Little The code is The code works The code works but The code works correctly
Working code evidence of provided. More only in some misses some and appropriately
Design and coding is details to justify scenarios. Work is details. Work is addresses cases which
Presentation apparent or work are needed. presented with a few presented with lead to no solution or an
of Work is not Proper details, justified details, justified infinite number of
addressing terminology with incorrect with mostly proper solutions. Work is
the task. should be used. terminology. terminology. presented with details,
justified thoroughly with
proper terminology.
Little Some thinking and Thinking and Thinking and Thinking and calculations
Calculations evidence of calculations are calculations are calculations are are shown and stated
for isolating isolating a shown. Some shown and stated for shown for a correctly for a multi-step
the variable variable is evidence of using a simple one-step multi-step equation equation. Possible division
presented. inverse operations equation or there are or are stated mostly by zero is correctly
is shown. Solution some mistakes. correctly. identified in solution.
shows limited Solution shows Solution shows Solution demonstrates
understanding. some understanding. considerable thorough understanding.
understanding.
Test cases Not all Verification steps All verification Verification steps All verification steps done
verification show limited steps done correctly done for a for a multi-step equation,
steps done: understanding. for a one-step multi-step equation demonstrates thorough
test case, Problems with equation. with minor errors. understanding.
LS/RS check written solution,
and LS/RS check and
screenshot screenshot of code.
Little or no Limited Strategy explained Strategy explained Strategy explained for a
Strategy explanation explanation of correctly for a for a multi-step multi-step equation
explained of strategy is the strategy is one-step equation or equation correctly thoroughly and with
provided. provided with a is mostly correct or but missing minor details.
few details. missing details. details.

©2020 Angjeli

You might also like