score = 0 rating = int(input("Enter star rating: ")) shares = int(input("Enter number of shares: ")) if rating == 1 or 2:     if shares < 1000:         score = rating*shares*2         print("The score is : ", score)     if shares >= 1000:         score = rating*shares         print("The score is : ", score) if rating == 3 or 4:     if shares < 2500:         score = rating*shares*3         print("The score is : ", score)     if shares >= 2500:         score = rating*shares         print("The score is : ", score) if rating == 5:     if shares < 5000:         score = rating*shares*4         print("The score is : ", score)     if shares >= 5000:         score = rating*shares         print("The score is : ", score) This is what I have so far. When I do 3 stars 1000 shares it says: The score is :  3000 The score is :  9000 idk why it does the 3000 one These are the tests it has to pass 1) Test: 1 Star, 450 Shares 2) Test: 2 Stars, 1500 Shares 3) Test: 3 Stars, 1000 Shares  4) Test: 4 Stars, 3500 Shares 5) Test: 5 Stars, 500 Shares 6) Test: 5 Star, 6500 Shares

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter10: Data Analysis With Power Tools And Creating Macros
Section: Chapter Questions
Problem 3EYW
icon
Related questions
Question

score = 0
rating = int(input("Enter star rating: "))
shares = int(input("Enter number of shares: "))
if rating == 1 or 2:
    if shares < 1000:
        score = rating*shares*2
        print("The score is : ", score)
    if shares >= 1000:
        score = rating*shares
        print("The score is : ", score)
if rating == 3 or 4:
    if shares < 2500:
        score = rating*shares*3
        print("The score is : ", score)
    if shares >= 2500:
        score = rating*shares
        print("The score is : ", score)
if rating == 5:
    if shares < 5000:
        score = rating*shares*4
        print("The score is : ", score)
    if shares >= 5000:
        score = rating*shares
        print("The score is : ", score)

This is what I have so far. When I do 3 stars 1000 shares it says:

The score is :  3000
The score is :  9000

idk why it does the 3000 one

These are the tests it has to pass

1) Test: 1 Star, 450 Shares

2) Test: 2 Stars, 1500 Shares

3) Test: 3 Stars, 1000 Shares 

4) Test: 4 Stars, 3500 Shares

5) Test: 5 Stars, 500 Shares

6) Test: 5 Star, 6500 Shares

 

NaturePic is a new social media app that lets you rate and share photos of nature scenes.
Images get a score based on several criteria. Users can rate the images on a scale of 1 to 5
stars. Users can also share the images with their friends. The overall score is computed based
on the following table:
Average Star Rating
Num Shares
Score
Less than 1000
Star Rating * Shares * 2
1- 2
Star Rating * Shares
Star Rating * Shares * 3
Star Rating * Shares
1000 or more
Less than 2500
3 - 4
2500 or more
Star Rating * Shares * 4
Star Rating * Shares
Less than 5000
5000 or more
Write a short python program that asks the user to enter the star rating and the number of
shares for an image, and then computes and prints the score for the image.
Your output should look something like this:
Enter star rating: 1
Enter number of shares: 450
The score is : 900
>>>
RESTART:
Enter star rating: 4
Enter number of shares: 3500
The score is : 14000
>>>
Transcribed Image Text:NaturePic is a new social media app that lets you rate and share photos of nature scenes. Images get a score based on several criteria. Users can rate the images on a scale of 1 to 5 stars. Users can also share the images with their friends. The overall score is computed based on the following table: Average Star Rating Num Shares Score Less than 1000 Star Rating * Shares * 2 1- 2 Star Rating * Shares Star Rating * Shares * 3 Star Rating * Shares 1000 or more Less than 2500 3 - 4 2500 or more Star Rating * Shares * 4 Star Rating * Shares Less than 5000 5000 or more Write a short python program that asks the user to enter the star rating and the number of shares for an image, and then computes and prints the score for the image. Your output should look something like this: Enter star rating: 1 Enter number of shares: 450 The score is : 900 >>> RESTART: Enter star rating: 4 Enter number of shares: 3500 The score is : 14000 >>>
Expert Solution
Given Code:

score = 0
rating = int(input("Enter star rating: "))
shares = int(input("Enter number of shares: "))
if rating == 1 or 2:
    if shares < 1000:
        score = rating*shares*2
        print("The score is : ", score)
    if shares >= 1000:
        score = rating*shares
        print("The score is : ", score)
if rating == 3 or 4:
    if shares < 2500:
        score = rating*shares*3
        print("The score is : ", score)
    if shares >= 2500:
        score = rating*shares
        print("The score is : ", score)
if rating == 5:
    if shares < 5000:
        score = rating*shares*4
        print("The score is : ", score)
    if shares >= 5000:
        score = rating*shares
        print("The score is : ", score)

steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Mathematical functions
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage