The Yuba College Library would like a program to calculate patron fines for overdue books. Fines are determined as follows: Paperbacks Regular $.20 / day with a maximum fine of $8.00 Best-Sellers $.50 / day with a maximum fine of $15.00 Magazines $.25 / day with a maximum fine of $5.00 Hardcover Books $.30 / day with a maximum fine of $23.00 The program must prompt the user to enter the following information at the keyboard. Data entry MUST be validated as required. Fines must also be calculated using a function(s). A class object should contain the methods (functions) to determine library fine. Provide a UML and description of disign.Patron’s library card number (a 4-digit number) - ValidatePatron’s namePatron’s addressType of book - ValidateNumber of days over due - ValidateA sample interactive session is shown below:Enter the patron’s card number: 2089Enter the patron’s name: Erica RobinsonEnter the patron’s address: 2234 RoadWay Trl.Enter the book’s title: The Trail Less Traveled.1. Paperback - Regular2. Paperback - Bestseller3. Magazine4. Hardcover bookEnter number corresponding to type of book (1 – 4): 4Enter the number of days overdue: 11Do you wish to perform another transaction?

Answers

Answer 1

Answer:

Explanation:

The following Python code creates all of the necessary functions in order to request and validate all of the inputs from the user. Once everything is entered and validated it calculates the total fee and outputs it to the user. Also calls the entire class at the end using a test variable...

class Customer:

   library_card = 0

   patrons_name = ""

   patrons_address = ""

   type_of_book = ""

   book_title = ""

   days_overdue = 0

   fee = 0.0

   book_list = ['paperback regular', 'paperback best seller', 'magazine', 'hardcover']

   def __init__(self):

       self.library_card = self.get_library_card()

       self.patrons_address = input("Patron's Address: ")

       self.book_title = input("Book Title: ")

       self.type_of_book = self.get_type_of_book()

       self.days_overdue = float(self.get_days_overdue())

       self.calculate_total()

       print("Your total Fee is: " + str(self.fee))

   def get_library_card(self):

       library_card = int(input("Enter 4-digit library card number: "))

       if (type(library_card) == type(0)) and (len(str(library_card)) == 4):

           return library_card

       else:

           print("Invalid Card number:")

           self.get_library_card()

   def get_type_of_book(self):

       type_of_book = input("Type of Book 1-4: ")

       if (int(type_of_book) > 0) and (int(type_of_book) <= 4):

           return int(type_of_book)

       else:

           print("Invalid Type")

           self.get_type_of_book()

   def get_days_overdue(self):

       days_overdue = input("Number of Days Overdue: ")

       if int(days_overdue) >= 0:

           return days_overdue

       else:

           print("Invalid number of days")

           self.get_days_overdue()

   def calculate_total(self):

       if self.type_of_book == 1:

           self.fee = 0.20 * self.days_overdue

           if self.fee > 8:

               self.fee = 8

       elif self.type_of_book == 2:

           self.fee = 0.50 * self.days_overdue

           if self.fee > 15:

               self.fee = 15

       elif self.type_of_book == 3:

           self.fee = 0.25 * self.days_overdue

           if self.fee > 5:

               self.fee = 5

       else:

           self.fee = 0.30 * self.days_overdue

           if self.fee > 23:

               self.fee = 23

test = Customer()

The Yuba College Library Would Like A Program To Calculate Patron Fines For Overdue Books. Fines Are

Related Questions

Which of the following cannot be used in MS Office.
Joystick
Scanner
Light Pen
Mouse

Answers

Answer:

A.

Explanation:

A Joystick is a control device that is connected to the computer to play games. A joystick is similar in structure to a control stick used by pilots in airplanes and got its name from the same. A joystick contains a stick, base, extra buttons, auto switch fire, trigger, throttle, POV hat, and a suction cup. A joystick also serves the purpose of assistive technology.

The device which can not be used in MS Office is a joystick. Therefore, option A is correct.

(08.02 LC)
It is appropriate to leave sections of an application blank.
O True
O False

Answers

Explanation:

it is false because it is not appropriate

I think it is false to

All operations used to construct algorithms belong to one of three categories: sequential, conditional, or iterative. Below is a list of steps from a variety of algorithms. Determine which category to which each of the steps belong (sequential, conditional, or iterative). If the value of test_grade is between 90 and 100, assign a letter grade of A.
Prompt the user for a number, get number from user
Sequential Repeat steps 3-5 until count = 10
If divisor = 0, print error_message
Complete step 1, complete step 2, complete step 3

Answers

Answer:

Answered

Explanation:

1) Conditional category because it uses an IF statement: If value of test grade is between 90-100 assign A.

2) Sequential category: Prompt user for number and get number from user.

3) Iterative category because it is looping: Repeat steps 3-5 until count equals 10.

4)Conditional category: If divisor equals zero print error.

5) Sequential category.

If name is a String instance variable, average is a double instance variable, and numOfStudents is a static int variable, why won’t the following code from a class compile?public Student(String s) {name = s;average = getAverage(name);numOfStudents++;}public double getAverage(String x) {numOfStudents++;double ave = StudentDB.getAverage(x);return ave;}public static void setAverage(double g) {average = g;}a.The setAverage() method can’t access the average instance variable.b.The getAverage() method can’t increment the numOfStudents variable.c.The constructor can’t increment the numOfStudents variable.d.The getAverage() method can’t call a static method in the StudentDB class.

Answers

Answer:

a.

Explanation:

Based solely on the snippet of code provided on the question the main reason why the code won't compile (from the options provided) is that the setAverage() method can’t access the average instance variable. Since the average variable is an instance variable it means that it only exists inside the one of the functions and not to the entire class. Meaning that in this scenario it can only be accessed by the Student function and once that function finishes it no longer exists. Also, it is not one of the options but if these variables are instance variables as mentioned their type needs to be defined inside the function.

Computer programming 2

Answers

Here is the second photo

A drunkard in a grid of streets randomly picks one of four directions and stumbles to the next intersection, then again randomly picks one of four directions, and so on. You might think that on average the drunkard doesn’t move very far because the choices cancel each other out, but that is actually not the case. Represent locations as integer pairs (x, y). Implement the drunkard’s walk over 100 intersections, starting at (0, 0), and print the ending location.

Answers

Answer:

its c so its c

Explanation:

Overheating of a computer can be easily prevented. Explain how​

Answers

Here are a few examples:

•] Keep away from windows or vents to prevent it from turning warm.

•] Clean off dust that’s on the computer.

•] Remove all the things that are blocking air to pass to let it cool down.

•] Putting a soft item below the computer is a action that is prohibited as it blocks the airways which causes it to overheat instead put it on a sturdy flat surface to prevent the aforementioned information.

•] To never overcharge your computer too 100% overnight or any time of the day since it overheats and causes battery life to be short, instead put it to charge when you’re conscious while keeping an eye on it, perhaps set a timer/alarm to notify you if you forget.

In cell F5, enter a formula using the PMT function. Insert a negative sign (-) after the equal sign in the formula to display the result as a positive amount. Use defined names for the rate, nper, and pv arguments as follows:
· rate argument: Divide the Rate by 12 to use the monthly interest rate.
· nper argument: Multiply the Term by 12 to specify the number of months as the periods.
· pv argument: Use the Loan_Amount as the present value of the loan.
2.In cell F6, enter a formula without using a function that multiplies 12 by the Term and the Monthly_Payment, and then subtracts the Loan_Amount to determine the total interest
3. in cell J5, enter another formula using the PV function. Use defined cell names for the rate, nper, and pmt arguments as follows:
· rate argument: Divide the Rate by 12 to use the monthly interest rate.
· nper argument: Subtract the year value in cell H5 from the Term, and then multiply the result by 12 to specify the number of months remaining to pay off the loan.
· pmt argument: Use the Monthly_Payment as a negative value to specify the payment amount per period.

Answers

Answer:

Open MS-Office Excel (a.) Define name for rate, nper and pv cells as Rate, Term and Loan_Payment. Select the cell then Menu > Formulas

Write C programs that output the following patterns exactly. Use loops to implement the repetitive part of the code. No functions or arrays are allowed?

Answers

Answer:

your a legend you can do it just pleave

Explanation:

:)

5. In an array-based implementation of the ADT list, the getEntry method locates the entry by a. going directly to the appropriate array element b. searching for the entry starting at the beginning of the array working to the end c. searching for the entry starting at the end of the array working to the beginning d. none of the above

Answers

Expert Answer for this question-

Explanation:

Answer- C

Computer programming

Answers

Sjanqknjwolq esjkalqlkd

how to view a pivate acont on Intagam​

Answers

You can just make a new account and pretend your someone else and send them a request :)

Write a script that will calculate a person’s weight on each planet of the solar system, the sun, and the moon. You should create an html form with text boxes for each planet (also the sun and moon). You should also have a text box for a person to enter their weight on Earth. When the user clicks on a button, a javascript function should be called that calculates each weight and puts the results in the corresponding text boxes in the form. Use the Math.round method to round the numbers to the nearest whole number. Here are some formulas for the conversions.

Mercury= weight * .378
Venus = weight * .907
Mars = weight * .377
Jupiter = weight * 2.364
Saturn = weight * .916
Uranus = weight * .889
Neptune = weight * 1.125
Pluto = weight * .067
Sun = weight * 27.072
Moon = weight * .166

Answers

Answer:

to.use his you should use qbasic and type as it os at last press f5 to see ans

Create an array of doubles to contain 5 values Prompt the user to enter 5 values that will be stored in the array. These values represent hours worked. Each element represents one day of work. Create 3 c-strings: full[40], first[20], last[20] Create a function parse_name(char full[], char first[], char last[]). This function will take a full name such as "Noah Zark" and separate "Noah" into the first c-string, and "Zark" into the last c-string. Create a function void create_timecard(double hours[], char first[], char last[]). This function will create (write to) a file called "timecard.txt". The file will contain the parsed first and last name, the hours, and a total of the hours. See the final file below. First Name: Noah

Answers

Solution :

[tex]$\#$[/tex]include [tex]$<stdio.h>$[/tex]  

[tex]$\#$[/tex]include [tex]$<string.h>$[/tex]    

void parse[tex]$\_$[/tex]name([tex]$char \ full[]$[/tex], char first[tex]$[],$[/tex] char last[tex]$[])$[/tex]

{

// to_get_this_function_working_immediately, _irst

// stub_it_out_as_below._When_you_have_everything_else

// working,_come_back_and_really_parse_full_name

// this always sets first name to "Noah"

int i, j = 0;

for(i = 0; full[i] != ' '; i++)

  first[j++] = full[i];

first[j] = '\0';  

// this always sets last name to "Zark"

j = 0;

strcpy(last, full+i+1);

// replace the above calls with the actual logic to separate

// full into two distinct pieces

}

int main()

{

char full[40], first[20], last[20];

double hours[5];

// ask the user to enter full name

printf("What is your name? ");

gets(full);

// parse the full name into first and last

parse_name(full, first, last);

// load the hours

for(int i = 0; i < 5; i++)

{

   printf("Enter hours for day %d: ", i+1);

   scanf("%lf", &hours[i]);

}

// create the time card

FILE* fp = fopen("timecard.txt", "w");

fprintf(fp, "First Name: %s\n", first);

fprintf(fp, "Last Name: %s\n", last);

double sum = 0.0;

for(int i = 0; i < 5; i++)

{

   fprintf(fp, "Day %i: %.1lf\n", i+1, hours[i]);

   sum += hours[i];

}

fprintf(fp, "Total: %.1f\n", sum);    

printf("Timecard is ready. See timecard.txt\n");

return 0;

}

what is computer? different between RAM and ROM?​

Answers

Answer:

RAM, which stand for RANDOM ACESS MEMORY and ROM whitch stand for READ ONLY MEMORY, are both present in your computer. RAM volatile memory that temporary store the file you are working on. ROM is a non volatile memory that permanently stores instruction for your COMPUTER.

In C++
Write a simple program to test your Circle class. The program must call every member function at least once. The program can do anything of your choice.

Answers

Answer:

int main() {

   Circle* pCircle = new Circle(5.0f, 2, 3);

   pCircle->up();

   pCircle->down();

   pCircle->left();

   pCircle->right();

   cout << "X: " << pCircle->getx() << endl;

   cout << "Y: " << pCircle->gety() << endl;

   cout << "Radius: " << pCircle->getRadius() << endl;

   pCircle->print();

   pCircle->update_radius(4.0f);

   if (pCircle->isUnit()) {

       cout << "is unit" << endl;

   }

   pCircle->move_x(10);

   pCircle->move_y(10);

}

Explanation:

something like that?

The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC value is either the next sequential microcode instruction in the control store (PROM), or a microcode instruction in the control store pointed to by the ADDR bits in the current executing microinstruction. What part of the current executing microcode instruction determines the value placed in the MPC

Answers

Answer:

MAR bit

Explanation:

The MPC computers area set of software and hardware standards that was developed by the consortium of computer firms which is led by Microsoft. It contains the address of a next microcode for the Mic1 emulator foe execution.

The part of the executing microcode instruction that determines the value which is placed in the MOC is the MAR bit. The MAR is the memory address register in the CPU which stores the memory address or such addresses to which some data will be sent and also stored.

Which functions do you use to complete Step 3e? Check all that apply.

Animations tab
Animation styles
Design
Lines
Motion Paths
Reordering of animations

Answers

Answer: Animations tab

Animation styles

Lines

Motion paths

Explanation: Edg2021

indicates the beginning and ending of your code written in HTML

Answers

Answer:

<body> ...</body>

indicates the beginning and ending of your code written in HTML

Explanation:

Which field would best function as a primary key for a table that tracks orders?
OrderDate
CustomerType
OrderID
CustomerID

Answers

Answer:

Order ID

Explanation:

An order ID is a new ID for every order. Every number is unique, making it the beat way to find certain orders.

Answer:

C

Explanation:

3 uses of Microsoft word in hospital

Answers

Explanation:

You can write, edit and save text in the program.

Is social media bringing people together or cause in sepretation?​

Answers

Answer:

IT BRINGS PEOPLE TOGETHERRRR

Explanation:

Ive met so many new people on Discord and I love them more than life its self

Answer:

Social media brings people together in my opinion because before social media people only had the option to call and message. Now with social media we have a way to express our creativity with pictures and videos that you can watch from your phone from anywhere.

internet is an interconnected networks
o true
o false

Answers

Answer:

True.

Internet is an interconnected network.

Define a function below, count_over_100, which takes a list of numbers as an argument. Complete the function to count how many of the numbers in the list are greater than 100. The recommended approach for this: (1) create a variable to hold the current count and initialize it to zero, (2) use a for loop to process each element of the list, adding one to your current count if it fits the criteria, (3) return the count at the end.

Answers

Answer:

In Python:

def count_over_100(mylist):

   kount = 0

   for i in range(len(mylist)):

       if mylist[i] > 100:

           kount+=1

   return kount

Explanation:

This defines the function

def count_over_100(mylist):

(1) This initializes kount to 0

   kount = 0

(2) This iterates through the loop

   for i in range(len(mylist)):

If current list element is greater tha 100, kount is incremented by 1

       if mylist[i] > 100:

           kount+=1

This returns kount

   return kount

An early attempt to force users to use less predictable passwords involved computer-supplied passwords. The passwords were eight characters long and were taken from the character set consisting of lowercase letters and digits. They were generated by a pseudorandom number generator with 215possible starting values. Using technology of the time, the time required to search through all character strings of length 8 from a 36-character alphabet was 112 years. Unfortunately, this is not a true reflection of the actual security of the system. Explain the problem.

Answers

Answer:

Recently, with the new and advanced hacking algorithms and affordable high-performance computers available to adversaries, the 36 character computer suggested passwords can easily be insecure.

Explanation:

The 8 length passwords generated pseudo-randomly by computers are not secure as there are new algorithms like the brute force algorithm that can dynamically obtain the passwords by looping through the password length and comparing all 36 characters to get the right one.

And also, the use of high-performance computers makes these algorithms effective

Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a list that contains only the non-strings from the original list. It is acceptable to return an empty list if there are only strings in the original list. This question uses the filter pattern discussed in lecture.

Answers

Answer:

Explanation:

The following code is written in Python and is a simple function that removes all of the type String elements within the list that has been passed as an argument. Then finally, prints out the list and returns it to the user.

def filter_out_str(list):

   for x in list:

       if type(x) == type(" "):

           list.remove(x)

   print(list)

   return list

Following are the python code to hold only string value into another list by using the given method:

Python code:

def filter_only_strs(l):#defining the method filter_only_strs that takes list type variable l in parameter

   r = []#defining an empty list r

   for x in l:#defining a loop that counts value of list

       if isinstance(x, str):#using if block that check list value is in string

           r.append(x)#using an empty list that holds string value

   return r#return list value

l=['d',12,33,"data"]#defining a list l

print(filter_only_strs(l))#calling the method filter_only_strs

Output:

Please find the attached file.

Program Explanation:

Defining the method "filter_out_strs", which takes one argument of list type that is "l".Inside the method, an empty list "r" is defined, and in the next line, a for loop is declared.Inside the for loop list "l" is used with a conditional statement that uses the "isinstance" method that checks string value in the list and adds its value in "r", and returns its value.

Find out more about the list in python here:

brainly.com/question/24941798

# 1) Complete the function to return the result of the conversion
def convert_distance(miles):
km = miles * 1.6 # approximately 1.6 km in 1 mile

my_trip_miles = 55

# 2) Convert my_trip_miles to kilometers by calling the function above
my_trip_km = ___

# 3) Fill in the blank to print the result of the conversion
print("The distance in kilometers is " + ___)

# 4) Calculate the round-trip in kilometers by doubling the result,
# and fill in the blank to print the result
print("The round-trip in kilometers is " + ___)

Answers

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)          return km

 

return km returns the result of the computation

2)  = convert_distance(my_trip_miles)

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + str(my_trip_km)

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

Create a class SavingsAccount. Use a static class variable to store the annualInterestRate for each of the savers. Each object of the class contains a private instance variable savingsBalance indicating the amount the saver currently has on deposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the balance by annualInterestRate divided by 12;

Answers

Answer:

Explanation:

The following code is written in Java and creates the requested variables inside the SavingsAccount class, then it creates a contructor method to add a value to the savingsBalance per object creation. And finally creates a calculateMonthlyInterest method to calculate the interest through the arithmetic operation provided in the question...

public class SavingsAccount {

   static double annualInterestRate = 0.03;

   private double savingsBalance;

   

   public void SavingsAccount(double savingsBalance) {

       this.savingsBalance = savingsBalance;

   }

   

   public double calculateMonthlyInterest() {

       return ((savingsBalance * annualInterestRate) / 12);

   }

}

The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular forma

Answers

Answer:

In Python:

fname = input("Filename: ")

a_file = open(fname)

lines = a_file.readlines()

print("Name\t\tHours\t\tTotal Pay")

for line in lines:

eachline = line.rstrip(" ")

for cont in eachline:

 print(cont,end="\t")

print()

Explanation:

This prompts the user for file name

fname = input("Filename: ")

This opens the file

a_file = open(fname)

This reads the lines of the file

lines = a_file.readlines()

This prints the header of the report

print("Name\t\tHours\t\tTotal Pay")

This iterates through the content of each line

for line in lines:

This splits each line into tokens

eachline = line.rstrip(" ")

This iterates through the token and print the content of the file

for cont in eachline:

 print(cont,end="\t")

print()

A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive investigation, the facility discovers many of the SCADA controllers have been infected by a new strain of malware that uses a zero-day flaw in the operating system. Which of the following types of malicious actors is MOST likely behind this attack?
A. A nation-state.
B. A political hacktivist.
C. An insider threat.
D. A competitor.

Answers

Answer:

A. A nation-state.

Explanation:

Given that a nation-state attack if successful is about having access to the different sector or industries of networks, then followed it by compromising, defrauding, altering (often for fraud purpose, or destroy information

Therefore, in this case, considering the information giving above, the type of malicious actor that is MOST likely behind this attack is "a Nation-State."

Other Questions
What fractions that are the same equals to 3/4 f(x)=1/4x-2 graph the function and the inverse A construction company pours concrete at a constant rate to make a sidewalk. There are 1,054 cubic feet of concrete available, and 6.2 cubic feet of concrete is poured each minute. The equation below shows the total volume, in cubic feet, of concrete remaining minutes after the construction company begins to pour the concrete. Based on the text and the image provided, what can we infer the meaning of 'weedy trophies in line 127)The trophies are a metaphor for flowers that Ophelia collectedB)The trophies' are a metaphor for the good memories from Ophelia's past.HighlightsTimeRemaining00:03:54The word "trophies" is used ironically to represent punishments shedeservesDThe word "trophies' is an allusion to heaven Match each claim on the left to its counterclaim on the rightTrue brotherhood is respecting theseparateness of others.States cannot disobey federal lawsagainst segregation.States have the right to maintain racialsegregationInvoluntary segregation does notrespect the rights of individuals.Segregation allows for separate butequal status of people.People cannot be equal if they areseparated in public places A9Kylie drives 291 miles in 6 hours.(a) What is her average speed? Distribute and Combine Like Terms. 2(x + 7) - 2x ASAP PLEASE HELP ME!!!!!!!!Do you think Castro's strategyof using graffiti to raise awareness about domesticviolence worked? Have the economic reforms started by Deng in the late 1970s been successful?No. Portions of Chinas population still live in poverty.Yes. Business in China is now free of all government control.No. Despite growth, the government has high levels of debt.Yes. China has one of the worlds highest gross domestic products. What is the pH of 0.12M HNO3 Explain how the imagery contributes to a particular narrative element? Studies indicate that individuals who consume ______are at a greater risk of victimization. Ready for this quick math? 10 + 5 x 14 + 32 x 11 - 2 x 1 + 56 x 111 + 76 - 83458 =. Try solving this. ( Then subscribe to socksfor1). An electromagnet is different from an iron magnet because A It will require a battery pack to charge it B. it can also be plugged in to run a toaster C. it is created by an electric current D. it is always painted bluePLEASE HELP THIS IS FOR A SERIOUS TEST who know this question? 20% of what number is 80? Pls help me just drop the answer below I need help fast The question is in the photo. What is the correct answer based on sig figs for the following 4.2787 x 2.27= 9.712649A. 9.712649B. 9.7126C. 9.7D. 9.71 what challenges do you think made it difficult for explorers to circumnavigate the world for the first time