Question 1) Create a Python program called "test3_firstname_latename" with 2 function calls in the main body as shown below: add_star() longest_run() (These functions are defined later) 1- In algebraic expressions, the symbol for multiplication is often left out, as in 3x+4y or 3(x+5). Computers prefer those expressions to include the multiplication symbol, like 3*x+4*y or 3*(x+5). Create a function called add_star() that asks the user for an expression. Your function must print the original expression and also the modified expression. You may assume the input expression is consisted of the following characters: Variable names are 0ne character long, i.e. xy is 2 variables x and y. Valid operators are +,-,* and /. ( and ) characters Numbers are of any length. Two examples are shown below:

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter3: Coding With Variables, Named Constants, And Calculations
Section: Chapter Questions
Problem 3MQ4
icon
Related questions
Question

Question 1) Create a Python program called "test3_firstname_latename" with 2 function calls in the main body as shown below:

add_star()
longest_run() (These functions are defined later)

1- In algebraic expressions, the symbol for multiplication is often left out, as in 3x+4y or 3(x+5). Computers prefer those expressions to include the multiplication symbol, like 3*x+4*y or 3*(x+5). Create a function called add_star() that asks the user for an expression. Your function must print the original expression and also the modified expression.
You may assume the input expression is consisted of the following characters:
Variable names are 0ne character long, i.e. xy is 2 variables x and y.
Valid operators are +,-,* and /.
( and ) characters
Numbers are of any length.
Two examples are shown below:

 

 

Please try to answer within 30 - 45 minutes.

Enter an expression: 125xy(x+y)
125*x*y*(x+y")
Transcribed Image Text:Enter an expression: 125xy(x+y) 125*x*y*(x+y")
Enter an expression: 2x (xy+3)
2*** (x*y+3)
Transcribed Image Text:Enter an expression: 2x (xy+3) 2*** (x*y+3)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning