
Concept explainers
# Obtain the last three numerical digits of the PI
PI = (input("enter PI number:"))
XYZ = PI[-3:]
# Use the three digits to create the number 1.01XYZ
def individual_number():
individual_number = (1.01 + XYZ)
# Return the individual number
return individual_number
# Write the PI and individual number in the document
# ask the user for fat grams and carbohydrate grams
fat_grams = int(input("Enter the number of fat grams: "))
carb_grams = int(input("Enter the number of carbohydrate grams: "))
# calculate the number of calories from fat and carbs
cal_fat = fat_grams * 9
cal_carb = carb_grams * 4
# calculate the total number of calories
cal_total = cal_fat + cal_carb
# calculate the estimated number of calories using the individual number
cal_estimated = round(cal_total * 1.01 + XYZ)
# print the result to the user
print("Estimated number of calories:", cal_estimated)
this is my code
and the error i am getting, help please
![# Obtain the last three numerical digits of the PI
PI = (input ("enter PI number: "))
XYZ = PI [-3:]
# Use the three digits to create the number 1.01XYZ
def individual_number ():
individual_number=
(1.01 + XYZ)
# Return the individual number
return individual_number
# Write the PI and individual number in the document
# ask the user for fat grams and carbohydrate grams
fat_grams = int (input ("Enter the number of fat grams: "))
carb_grams = int (input ("Enter the number of carbohydrate grams: "))
# calculate the number of calories from fat and carbs
cal_fat = fat grams
9
cal_carb = carb_grams * 4
# calculate the total number of calories
cal_total = cal_fat + cal_carb
# calculate the estimated number of calories using the individual number
cal_estimated = round (cal_total* 1.01 + XYZ)
#print the result to the user
print ("Estimated number of calories:", cal_estimated)](https://content.bartleby.com/qna-images/question/47200b4c-a8f9-447b-94f9-99e5421d54a1/148aa858-e03c-43e7-8a05-a772c31c306e/fakszzq8_thumbnail.jpeg)

Step by stepSolved in 2 steps with 2 images

- Part: 6 Please answer the ques in Python with showing the code.Answeer the ques ASAParrow_forwardAssignment details: Replace all the 0 (Zero) digits in your ID by 4. Example: If your ID is 38104680, it becomes 38144684 Take the first 6 digits and substitute them in this expression (( A + B) / C) * ((D-E)/F)-2) according to the following table; Letter Replace by Digit Example Digit A 1st 3 B 2nd 8 C 3rd 1 D 4th 4 E 5th 4 F 6th 6 After substitution your expression will be similar to this (( 3 + 8) / 1) * ((4-4)/6)-2). Draw a rooted tree that represents your expression. [3 marks] What is the prefix form of this expression. What is the value of the prefix expression obtained in step 2 above?arrow_forwardProgram Purpose - Professional Athletes often hire other professionals to help take care of matters for them. We will group them in four categories: Lawyers, Personal Assistants, Agents, and Trainers. They all get paid a percentage of the athlete's total yearly salary. Lawyers - 10%, Personal Assistants - 3%, Agents - 7%, and Trainers - 5% . Prompt the user to enter the athlete's salary for the year (ensure that the entered value is positive). The user should then enter the name and category of each of the hired professionals. The athlete should be able to hire as many professionals in each category as he/she wants, even if it is more than he/she can afford. Based on the category, calculate the amount that each professional should be paid. After all data has been entered, print the names of each professional hired, how much each is being paid, the total amount the athlete paid, and how much the athlete has left.arrow_forward
- CPP File #include "result.h"#include "Date.h" Result::Result(){m_name = "";m_unitID = "";m_credits = 0;m_mark = 0.0;m_day = 0;m_month = "";m_year = 0;} Result::Result( string name, string id,unsigned credits, double M , unsigned d, string m, unsigned y){m_name = name;m_unitID = id;m_credits = credits;m_mark = M;m_day = d;m_month = m;m_year = y;} istream & operator >>( istream & input, Result & RE){string strInput; getline(input,strInput, ','); RE.SetUnitID(strInput);getline(input, strInput, ','); RE.SetName(strInput);getline(input, strInput, ','); RE.SetCredits(stoi(strInput));getline(input, strInput, ','); RE.SetMark(stod(strInput));getline(input,strInput, ','); RE.SetDay(stoi(strInput));getline(input, strInput, ','); RE.SetMonth(strInput);getline(input, strInput, ','); RE.SetYear(stoi(strInput));getline(input, strInput, ','); return input;} ostream & operator <<( ostream & os,const Result & RE ){string unitID;string name;string month;double mark;…arrow_forwardGiven code line, std::string un_address = "405 East 42nd Street, New York, NY, 10017"; Fill in the blanks: 17 std::stoi(un_address) returns std::stoi (un_address.substr( std::stoi (un_address.substr(un_address.find("1"))) J 20)) returns 42 returnsarrow_forwardGiven: Pseudo code initialize char text set text= z print "%d", text What will be the value of variable text? 122 98 97 O Errorarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





