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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education