Question

Edit View History Bookmarks People Tab Window Help х Mind Tap - Cengage MindTap - Cengage Learning arse Modules: Summer 202 X
a X File Edit View History Bookmarks People Tab Window Help 15% D Wed Jul 29 10 07 PM QE Course Modules: Summer 202 X MindTap

the problem is in the first photo but when i try to code the problem and get the solution i get a 0% am o doing something wrong? need help
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans)

Yes, you did a mistake in the print function.

print("Total cost is $"+str(float(total)))

but it should be like this

print("Total cost is $",total)

Because '+' in the print function after a string represents string only.Thats why you get 0%.So use the comma for float.

Code :

new=int(input("Enter the number of new videos : ")) # ask the no. of new videos and convert into integer
old=int(input("Enter the number of old videos : ")) # ask the no. of new videos and convert into integer
total=(new*3.00)+(old*2.00) # calculate the total value and stored in total
print("total cost is $",total) # print the total value

1 2 3 4 5 new=int(input(Enter the number of new videos : )) # ask the no. of new videos and convert into integer old=int(in

Output :

Enter the number of new videos : 3 Enter the number of old videos : 2 total cost is $ 13.0

Enter the number of new videos : 5 Enter the number of old videos : 5 total cost is $ 25.0

Enter the number of new videos : 0 Enter the number of old videos: 0 total cost is $ 0.0

If any queries about answer please leave a comment...........

Please give positive rating..........

Thank you...........

Add a comment
Know the answer?
Add Answer to:
the problem is in the first photo but when i try to code the problem and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5 5 - Parallel Arrays in Python Mind Tap - Cengage Lea x + V A...

    5 5 - Parallel Arrays in Python Mind Tap - Cengage Lea x + V A https//ng.cengage.com/static/nb/ui/evo/index.html?deploymentid=5745322406056533358933471518eISBN=9781337274509&id=586434 145&snapshotld: L x ... € → O 1 » CENGAGE MINDTAP Q Search this course x Parallel Arrays in Python D Parallel Lists Jumpinjive.py + > Terminal + 1 # Jumpin Java.py - This program looks up and prints the names and prices of coffee orders. 2 # Input: Interactive 3 # Output: Name and price of coffee orders or error message if...

  • can someone assist me and tell me what I'm missing. I managed to get it this...

    can someone assist me and tell me what I'm missing. I managed to get it this far but still missing two parts to complete it. CENGAGE MINDTAP Programming Exercise 6-4 Tasks main.cpp + 1 #include <iostream r with successful Uses piand 2 #include <cnath> output 5,00 out of 10.00 3 using nanespace std; 4 5 const double PI = 3.1419; 2 out of 4 checks passed. Review 6 the results below for more details. 7 int main() 8 ( Checks...

  • Opening Files and Performing File Input 1 V/ Flowers.cpp This program reads nanes of flowers and ...

    Opening Files and Performing File Input in C++ Opening Files and Performing File Input 1 V/ Flowers.cpp This program reads nanes of flowers and whether they are grown in shade or sun from an input 2 file and prints the information to the user's screen. 3 Input: flowers.dat 41 Output: Names of flowers and the words sun or shade Summary In this lab, you open a file and read input from that file in a prewritten C++ program. The program...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT