Questions Uploads

Jill, Allen

I need help with this question. no one can give me the correct information. I keep changing it and the best I was able to score was 3/76.6 Warm up: Parsing strings (Python 3)

(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt)

  • Examples of strings that can be accepted:
  • Jill, Allen
  • Jill , Allen
  • Jill,Allen

Ex:

Enter input string: Jill, Allen

(2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts)

Ex:

Enter input string: Jill Allen
Error: No comma in string.
Enter input string: Jill, Allen

(3) Using string splitting, extract the two words from the input string and then remove any spaces. Output the two words. (2 pts)

Ex:

Enter input string: Jill, Allen
First word: Jill
Second word: Allen

(4) Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit. (2 pts)

Ex:

Enter input string: Jill, Allen
First word: Jill
Second word: Allen


Enter input string: Golden , Monkey
First word: Golden
Second word: Monkey


Enter input string: Washington,DC
First word: Washington
Second word: DC


Enter input string: q
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

movie collection

(1) Build a dictionary that contains the movie collection below. Hint: Combine movie title and director into a list. 

Year          Title                       Director

2005          Munich                      Steven Spielberg
2006          The Prestige                Christopher Nolan
2006          The Departed                Martin Scorsese
2007          Into the Wild               Sean Penn
2008          The Dark Knight             Christopher Nolan
2009          Mary and Max                Adam Elliot
2010          The King's Speech           Tom Hooper
2011          The Artist                  Michel Hazanavicius
2011          The Help                    Tate Taylor
2012          Argo                        Ben Affleck
2013          12 Years a Slave            Steve McQueen
2014          Birdman                     Alejandro G. Inarritu
2015          Spotlight                   Tom McCarthy
2016          The BFG                     Steven Spielberg

(2) Prompt the user for a single year and output the movie title(s) and director(s) from that year. Output N/A if the year is invalid. (4 pts) 

Ex:

Enter a year between 2005 and 2016:
2011
The Artist, Michel Hazanavicius
The Help, Tate Taylor

(3) After prompting the user for a year and displaying the title(s) and directors(s) from that year, display a menu. The menu enables a user to display the movies sorted by year, director, or movie title. Each option is represented by a single character.

The program initially outputs the menu, and outputs the menu after a user chooses an option. If an invalid character is entered, continue to prompt for a valid choice. The program ends when the user chooses the option to Quit. Hint: Implement Quit before implementing other options. For this step, the other options do nothing. (1 pt) 

Ex:

Enter a year between 2005 and 2016:
2011
The Artist, Michel Hazanavicius
The Help, Tate Taylor

MENU
Sort by:
y - Year
d - Director
t - Movie title
q - Quit

Choose an option:

(4) Implement the sort by year menu option. Note: There is a newline and a tab between the year and the movie title/director. (2 pts) 

Ex:

...
Choose an option:
y
2005:
    Munich, Steven Spielberg

2006:
    The Prestige, Christopher Nolan
    The Departed, Martin Scorsese

2007:
    Into the Wild, Sean Penn

2008:
    The Dark Knight, Christopher Nolan

...

(5) Implement the sort by director menu option. For directors with multiple films on the list, order their films by year. Note: There is a newline and a tab between the director’s name and the movie title/year. (3 pts) 

Ex:

...
Choose an option:
d
Adam Elliot:
    Mary and Max, 2009

Alejandro G. Inarritu:
    Birdman, 2014

Ben Affleck:
    Argo, 2012

Christopher Nolan:
    The Dark Knight, 2008
    The Prestige, 2006

...

(6) Implement the sort by movie title menu option. Note: There is a newline and a tab between the movie title and the movie director/year. (2 pts) 

Ex:

...
Choose an option:
t
12 Years a Slave:
    Steve McQueen, 2013

Argo:
    Ben Affleck, 2012

Birdman:
    Alejandro G. Inarritu, 2014

Into the Wild:
    Sean Penn, 2007

...
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

value in kilograms.

(1) Prompt the user to enter four numbers, each corresponding to a person’s weight in pounds. Store all weights in a list. Output the list. (2 pts) 

Ex:

Enter weight 1: 236
Enter weight 2: 89.5
Enter weight 3: 176.0
Enter weight 4: 166.3

Weights: [236.0, 89.5, 176.0, 166.3]

(2) Output the average of the list’s elements. (1 pt)

(3) Output the max list element. (1 pt) 

Ex:

Enter weight 1: 236
Enter weight 2: 89.5
Enter weight 3: 176.0
Enter weight 4: 166.3

Weights: [236.0, 89.5, 176.0, 166.3]
Average weight: 166.95
Max weight: 236.0

(4) Prompt the user for a number between 1 and 4. Output the weight at the user specified location and the corresponding value in kilograms. 1 kilogram is equal to 2.2 pounds. (3 pts) 

Ex:

Enter a list index (1 - 4): 3
Weight in pounds: 176.0
Weight in kilograms: 80.0

(5) Sort the list’s elements from least heavy to heaviest weight. (2 pts) 

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

algorithm using pseudocode

Write algorithm using pseudocode for one of the following actions:

Converting military time (2400 hours) to standard time (12:00)

Counting down to a the following New Year’s eve in days, hours, minutes, and seconds

Determining the maximum area of a field you could create with a collection of 15 fence sections, each eight feet in length.

Prompting the user to input a set of grades and print the highest value, minimum value, and average.

Explain why you chose the type of control structures and/or loops used in your algorithm (if-else, for, while, etc.).

Explain how you might revise the algorithm you designed 

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"