Here's on C:
#include<stdlib.h>
<span>#include<stdio.h> </span>
<span>#include<conio.h> </span>
<span>long YardArea=0,HouseArea=0; </span>
<span>int YardLength=0,YardWidth=0,HouseLength=0,HouseWidth=0; </span>
<span>long GroundArea=0; </span>
<span>int TimeReqierd=0; </span>
<span>int GrassCutRate=2; </span>
<span>void main() </span>
<span>{ </span>
<span>char inp[256]; </span>
<span>clrscr(); </span>
<span>printf("your text text\n"); // put your greetings</span>
<span>printf("Input the leght of the yard\n"); </span>
<span>gets(inp); </span>
<span>YardLength= atoi(inp); </span>
<span>printf("input the width of the yard\n"); </span>
<span> gets(inp); </span>
<span>YardWidth=atoi(inp); </span>
<span> printf("input the length of the house\n"); </span>
<span> gets(inp); </span>
<span>HouseLength=atoi(inp); </span>
printf("input <span>the width of the house\n"); </span>
<span> gets(inp); </span>
<span>HouseWidth=atoi(inp); </span>
<span>HouseArea=HouseWidth *HouseLength ; </span>
<span>YardArea=YardWidth* YardLength; </span>
<span>GroundArea=YardArea-HouseArea; </span>
<span> TimeReqierd=GroundArea/GrassCutRate; </span>
<span>printf("%s%d","Grass Area is ",GroundArea); </span>
<span>printf("%s%d seconds"," \n time required to cut it out " ,TimeReqierd); </span>
<span>getchar(); </span>
<span>} </span>
Answer:
Following are the program in the Python Programming Language:
def check(num): #define function
if(num.isdigit()): #set if statement
return "yes"; #return yes if condition is true
else:
return "no";# return no if condition is false
string=input("Enter the numbers 0-9: ") #get input from the user
print(check(string)) #print and call the function
Output:
Enter the numbers 0-9: 1995
yes
Enter the numbers 0-9: 42,000
no
Explanation:
Here, we define a function "check()" and pass an argument in its parameter "num" inside the function.
- we set if-else conditional statement and check the value stored in the variable "num" is the digit by using built in function "isdigit()" then return "yes".
- Then, otherwise it return "no".
Finally, we get the input from the user in the variable "string" then, we call the function through "print()" function.
Answer:
7 page faults
Explanation:
I have created a small Java program that can be seen in the attached picture below. This Java program uses an LRU algorithm in order to find the number of page faults within an array of page references from the references given in the question. Using these references, and the java program we can see that there are a total of 7 page faults. This can be seen in the output highlighted by red in the picture below.