Question: Problem 1 ( 3 0 pts ) 3 input / output testsWrite a program that calculates the total movie ticket price for a group of
Problem pts inputoutput 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 years old: Free, regardless of the time.o Daytime prices:$ for anyone aged or above.o Nighttime prices:$ for ages to $ for ages to $ for ages 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? Enter the age of person : Enter the age of person : Enter the age of person : The total price for the movie tickets is: $Notes: 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 nonnegative integer. Prices vary based on the time and age, as per the provided rules.Problem Pts inputoutput 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, eg for 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 tax for income $o tax for income between $ and $o tax for income $ 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: Enter the loan's annual interest rate as a decimal, eg for : Enter your monthly income before taxes: Enter your monthly rent: Enter other monthly fixed expenses utilities subscriptions, etc.: How much do you want to pay towards the loan each month? It will take you months to pay off the loan.Notes: The monthly interest rate is the annual rate divided by 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 Pts inputoutput 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 login attempts. If the login fails after attempts, the account will be locked. If the username is not found, the program should terminate immediately.Requirements: Create a function loginsystemusername 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 eg characters match" or character matches" The program should allow up to attempts for the user to log ino After each failed attempt, provide feedback on how many characters matched.o If the user fails all 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 failed attempts.Example Interaction Successful Login:Enter your username: userEnter your password: passLogin failed: characters match.Enter your password: passwordLogin successful!Example Interaction Failed Login and Account Lock:Enter your username: userEnter your password: letLogin failed: characters match.Enter your password: letmeoutLogin failed: characters match.Enter your password: wrongpasswordLogin failed: characters match.Enter your password: letitgoLogin failed: characters match.Enter your password: openpleaseLogin failed: characters match.Account locked due to too many failed attempts.Example Interaction :Enter your username: userEnter 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 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
