1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Novay_Z [31]
2 years ago
6

Need help how to type the code please

Computers and Technology
1 answer:
jolli1 [7]2 years ago
4 0

Answer:

#include <stdio.h>

#define MAXIMUM_LOAN_PERIOD 14

#define FINE_RATE 0.20

#define SEPARATOR "----------------"

int main() {

 double amountFined;

 int numberOfBooks, daysLoan, daysOverdue;

 printf(SEPARATOR "\nBOOK LOAN SYSTEM\n" SEPARATOR "\n");

 

 printf("Enter the number of books  : ");

 scanf("%d", &numberOfBooks);

 printf("Enter the days of the loan : ");

 scanf("%d", &daysLoan);

 

 printf(SEPARATOR SEPARATOR SEPARATOR "\n");

 

 daysOverdue = daysLoan - MAXIMUM_LOAN_PERIOD;

 amountFined = FINE_RATE * numberOfBooks * daysOverdue;

 printf("Days overdue               : %d\n", daysOverdue);

 printf("Fine                       : RM %.2f\n", amountFined);

 return 0;

}

Explanation:

Reading integers can be done using scanf. What is missing in this code is checking for bad input, but the happy flow works!

You might be interested in
List out the storage measurements units of a computer .<br><br>​
xxTIMURxx [149]

Answer:

Computer storage and memory is often measured in megabytes (MB) and gigabytes (GB). A medium-sized novel contains about 1 MB of information. 1 MB is 1,024 kilobytes, or 1,048,576 (1024x1024) bytes, not one million byte

3 0
3 years ago
Read 2 more answers
Why might you use the More button in the Find and Replace dialog box?
den301095 [7]

Answer:

Use the More button to display more options to help narrow the search criteria.

Explanation:

<em> I think hope this helps you!!</em>

6 0
3 years ago
opearating system protection refers to a mechanism for controling access by programs, processes, or users to both system and use
Alekssandra [29.7K]

Answer:

The operating system must by the use of policies define access to and the use of all computer resources.

Policies are usually defined during the design of the system. These are usually default in settings. Others are defined and or modified during installation of the addon and or third-party software.

Computer Security Policies are used to exact the nature and use of an organisations computers systems. IT Policies are divided into 5 classes namely:

  1. General Policies
  2. Server Policies
  3. VPN Policies
  4. Back-Up Policies
  5. Firewall Access and Configuration Policies

Cheers!

5 0
4 years ago
What pointer appears when pointing to a hyperlink
Leokris [45]
Your answer would be: a hand pointer.
6 0
4 years ago
Read 2 more answers
Write a function called average() that takes a single parameter, a list of numeric values. The function should return the averag
QveST [7]

Answer:

The following code is in python.

import statistics as st #importing statistics which include mean function.

def average(lst): #function average.

   return st.mean(lst)#returning mean.

lst=a = list(map(int,input("\nEnter the list : ").strip().split()))#taking input of the list..

print("The average is "+str(average(lst)))#printing the average.

Output:-

Enter the list :

1 2 3 4 5 6

The average is 3.5

Explanation:

I have used the statistics library which includes the mean function that calculates the mean or average of the list.In the function average having lst as an argument returns the mean of the list lst.

Then taking lst input from the user and printing it's average.

3 0
3 years ago
Other questions:
  • To refine the in-between motions, a computer animator uses a mathematical function called a(n)
    14·1 answer
  • A user saves a password on a website the user logs into from a desktop. Under which circumstances will the password be saved on
    14·1 answer
  • When you lost important information how do you gain the information back?
    14·2 answers
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • When is Hytale coming out?<br><br><br> P.S it might be Mine-craft 2.0<br><br><br> :)
    7·1 answer
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • How to get the home button on your screen?
    13·1 answer
  • What is text box and label control​
    10·2 answers
  • What common variation of the Server Message Block (SMB) sharing protocol is considered to be a dialect of SMB?
    11·1 answer
  • Tại sao xe chỉ sản xuất ra 1996cc mà không phải là 2000cc?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!