Question 2:
# Three Dice game
# import library
import random
# roll three dice and store the results in the variables
# Add the points from both dice
# display message to guide user on how to use this program
# If total is more than 9, it is 'big'. Else, it is 'small'
# prompt user to guess small or big.
# convert the user input to lower case
# check if the user input is valid
# if the answer was not either small or big,
# shows invalid guess message
# check the value of total
# if it is greater than 9, assign the correct answer as big
# else assign the answer as small
ABC Banking maintains a record of their clients accounts in a text file named "custBalances.txt" using the following format:
accNo,Lastname,Firstname,PIN,balance
ABC clients would like to have a means to know their balances conveniently.
Your task is to write a program that will access the data of the customer from the text file by supplying their account number and PIN code. Given a valid account number and PIN, program must display the customer information.
Your program must use the following function in a separate python file
Input
1. data
Output
Enter·account·number:·356662421
Account·does·not·exist.
Enter·account·number:·356662420
Enter·PIN:·1676
Account·No.:·356662420
Customer·Name:·Branden·Rivers
Balance:·PHP·49,316.00
Enter·account·number:·X
Good·Bye!
Enter·account·number:·X
Good·Bye!Your college has a logging system for students internet activities. Daly logs 1000 of entries and stored in internet file as 12 lines. One day the IT administrator want to analyse for recent activities done by students, so he needs to access log entries from bottom first. Write a python function file-end(file-name, n) which accepts file name, number of lines it will read from last and return them in string as shown in example. Also, write the exception handling code to show the proper message. Also, write the exception handling code to show the proper message. Do not use input function and give input values in fixed form.
Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String.
Write a program that computes the cost of a long distance call. The cost of call is determined according to the following rate schedules.
• A call made between 8:00 AM and 6:00 PM is billed at a rate of 6 rupees per minute.
• A call made before 8:00 AM or after 6:00 PM is charged at a rate of 3.75 rupees.
According to this schedule, if a call starts at any time between 8:00 AM and 6:00 PM, and it ends after 6:00 PM then it will be charged at the rate of 6 rupees per minute for the time before 6:00 PM and for the rest of the time rate will be 3.75 rupees per minute. For example if a call starts at 5:55 PM and ends at 6:05 PM then charges on this call will be 48.75 (30 rupees for first 5 minutes and 18.75 rupees for rest of the time).
Similarly if call starts at the time before 8:00 AM but ends after 8:00 AM then it will be charged at rate of 3.75 rupees for the time before 8:00 AM and for remaining minutes after 8:00 AM the rate will be 6 rupees per minute.
Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String.
[You cannot use the built-in split function for this task]
Sample Input 1:
This-is-CSE110
-
Sample Output 1:
This
is
CSE110
Write a Python program that takes a String as input from the user, removes the characters at even index and prints the resulting String in uppercase without using the built-in function upper().
Sample Input 1:
String
Sample Output 1:
TIG
Using function, write and run a C++ program to computer the root of a quadratic equation,stating the conditions for real,complex and double roots respectively in your program
Using user defined function;write and run C++ program that computes the first 10 terms of an Arithmetic Progression (AP)
As a build up from the previous question, consider 3 possible scenario
of input : A character, number or word. You program should the do the following: In case
the input is a character it should indicate if it’s a vowel or not, when a number is entered
then it’s should check if it’s a prime and finally if a word is entered the system should check
if it’s a palindrome or not