Question: Problem 1 ( 3 0 pts ) 3 input / output testsWrite a program that calculates the total movie ticket price for a group of

Problem 1(30 pts)3 input/output testsWrite a program that calculates the total movie ticket price for a group of people, taking into account both their ages and the time of the movie.Requirements: The program should first ask whether the movie is being watched during the 'day' or 'night'. It should then ask how many people are watching the movie. For each person, the program should ask their age and calculate the price based on the following rules:o Toddlers (under 4 years old): Free, regardless of the time.o Daytime prices:$8 for anyone aged 4 or above.o Nighttime prices:$12 for ages 4 to 16, $15 for ages 17 to 54, $13 for ages 55 and above. The program should calculate and print the total price for all the tickets.Example Interaction:Are you watching the movie during the 'day' or 'night'? nightHow many people are watching the movie? 3Enter the age of person 1: 3Enter the age of person 2: 16Enter the age of person 3: 45The total price for the movie tickets is: $27Notes: The input for the time of the movie should be either 'day' or 'night'. The number of people and each age entered should always be a non-negative integer. Prices vary based on the time and age, as per the provided rules.Problem 2(30 Pts)5 input/output testsWrite a program that helps the user determine how long it will take to pay off a loan based on their monthly income, expenses, and payment amount. The program should calculate disposable income, allow the user to specify a monthly payment amount, and then determine how many months are needed to fully repay the loan.Requirements: The program should ask for:o The total loan amount.o The loan's annual interest rate (as a decimal, e.g.,0.05 for 5%).o The user's monthly income before taxes.o Monthly fixed expenses like rent and utilities.o The amount the user wants to pay toward the loan each month. Tax Brackets: The program should calculate taxes based on the following rules:o 10% tax for income $3000.o 20% tax for income between $3001 and $6000.o 30% tax for income > $6000. Loan Repayment: The program should apply the loan's interest monthly and subtract the users payment until the loan is paid off. The program should calculate and display how many months it will take to repay the loan. If the payment exceeds the user's disposable income (income after tax and fixed expenses), display a warning message.Example Interaction:Enter the total loan amount: 10000Enter the loan's annual interest rate (as a decimal, e.g.,0.05 for 5%): 0.05Enter your monthly income before taxes: 4000Enter your monthly rent: 1000Enter other monthly fixed expenses (utilities, subscriptions, etc.): 500How much do you want to pay towards the loan each month? 300 It will take you 36 months to pay off the loan.Notes: The monthly interest rate is the annual rate divided by 12. The monthly payment is applied after the loan balance has accrued interest for that month. If the user's specified payment exceeds their disposable income, the program should display a warning but still calculate the number of months required to pay off the loan. Problem 3(40 Pts)4 input/output testsInput username and password with stored credentials. Use a function to handle the login process, providing feedback on whether the login was successful or not. The user is allowed up to 5 login attempts. If the login fails after 5 attempts, the account will be locked. If the username is not found, the program should terminate immediately.Requirements: Create a function login_system(username, password) that:o Takes two arguments: a username and a password.o Checks if the username exists in the dictionary: If the username is not found, return "Login failed: Username not found." and terminate the program immediately.o Compares the input password with the stored password: If the passwords match exactly, return "Login successful!". If only some characters match in the same positions, return how many characters match (e.g.,"3 characters match" or "1 character matches"). The program should allow up to 5 attempts for the user to log in.o After each failed attempt, provide feedback on how many characters matched.o If the user fails all 5 attempts, lock the account and display a message indicating that the account has been locked.o If the username is not found, terminate the program immediately without further attempts. The program should stop once the user successfully logs in or after 5 failed attempts.Example Interaction 1(Successful Login):Enter your username: user1Enter your password: pass123Login failed: 4 characters match.Enter your password: password123Login successful!Example Interaction 2(Failed Login and Account Lock):Enter your username: user2Enter your password: letLogin failed: 3 characters match.Enter your password: letmeoutLogin failed: 5 characters match.Enter your password: wrongpasswordLogin failed: 0 characters match.Enter your password: letitgoLogin failed: 3 characters match.Enter your password: openpleaseLogin failed: 0 characters match.Account locked due to too many failed attempts.Example Interaction 3:Enter your username: user4Enter your password: anypasswordLogin failed: Username not found.Notes: The dictionary of usernames and passwords is predefined in the program. The comparison should only count characters that match in the same positions. Use a for loop to compare the password characters and count matches. After each attempt, if the password doesn't match exactly, provide feedback on how many characters match in the correct position. If the username is not found, the program should stop immediately without any password attempts. If the username is found, allow up to 5 attempts for the user to log in.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!