Explanation:
The precision in double values is twice as compared to float values.Hence double have smaller rounding errors as compared to float variables .A double is of 64 bits and float is of 32 bits usually hence floats have more rounding errors and on more number than doubles.Double has 15 decimal digits of precision and float has only 7 decimal digits for precision.
What is the period of a 2 KHz sine wave?
Answer:
Period of the given wave is 0.5 milliseconds.
Explanation:
We are given the frequency of the wave as 2 KHz
We know the relation between period and frequency of a wave is given by
[tex]Period=\frac{1}{frequency}[/tex]
Applying the given values we get
[tex]Period=\frac{1}{2\times 10^{3}}\\\\\therefore Period=0.5\times 10^{-3}seconds[/tex]
Thus period is 0.5 milliseconds.
The frequency of a sine wave is defined as:
a.the number of cycles per second
b.the maximum amplitude of the wave
c.the time for one cycle
d.the difference between the high frequency and the low frequency
Answer:
a.the number of cycles per second
Explanation:
The frequency of a sine wave is defined as the number of cycles per second.
Frequency is the inverse of the time period. The frequency of a sine wave is given by 1/TimePeriod . It is generally expressed in units of Hertz(Hz) or sec^-1. Larger the time period, lower will be the frequency and vice versa. So for higher frequency waves we need to ensure that the time period is small.
If the program does not handle an unchecked exception:
a.)
the program is halted and the default exception handler handles the exception
b.)
the program must handle the exception
c.)
the exception is ignored
d.)
this will cause a compilation error
Answer:a.) The program is halted and the default exception handler handles the exception
Explanation: If a exception is left out by the program handler then the processing is stopped and the control of exception handling is done to another handler. The unchecked exception is thus handled by the default exception handler.
Exception occur in the executing programs that try to stop the function by terminating it .The method used for the handling of the program is try catch and throw technique. Unchecked exception are found while the run-time and thus target the processing of the program.Thus,the correct option is option(a).
Other options are incorrect because the current program cannot handle the exception as it has left it unchecked, exception cannot be ignored because it stops the program and compilation error will not be caused.
. How does Word indicate a possible instances of inconsistent formatting?: *
a. With a wavy red underline
b. With a wavy blue underline
c. With a wavy green underline
d. This functionality is not available in Word
Answer:b)With a wavy blue underline
Explanation:Wavy blue lines in the Word document is for representing that the Format consistency checker is in working/on mode .It can identify the inconsistent format instances for the correction while the user is writing the text.
Other options are incorrect because wavy red line is for incorrect spelling of any word and wavy green line signifies the grammatical mistake .The function is available for the format inconsistency as wavy blue line in Word .Thus, the correct option is option(b).
How to determine if the function f(x) = x^2 + 3 from real numbers to real numbers is Injective, surjective, or bijective
Answer:
The function is not injective.
The function is not surjective.
The function is not bijective.
Explanation:
A function f(x) is injective if, and only if, [tex]a = b[/tex] when [tex]f(a) = f(b)[/tex].
So
[tex]f(x) = x^{2} + 3[/tex]
[tex]f(a) = f(b)[/tex]
[tex]a^{2} + 3 = b^{2} + 3[/tex]
[tex]a^{2} = b^{2}[/tex]
[tex]a = \pm b[/tex]
Since we may have [tex]f(a) = f(b)[/tex] when, for example, [tex]a = -b[/tex], the function is not injective.
A function f(x) is surjective, if, and only if, for each value of y, there is a value of x such that [tex]f(x) = y[/tex].
We have that y is composed of all the real numbers.
Here we have:
[tex]f(x) = y[/tex]
[tex]y = x^{2} + 3[/tex]
[tex]x^{2} = y - 3[/tex]
[tex]x = \sqrt{y-3}[/tex]
There is only a value of x such that [tex]f(x) = y[/tex] for [tex]y \geq 3[/tex]. So the function is not surjective.
A function f(x) is bijective when it is both injective and surjective. So this function is not bijective.
write a program that reads in initial saving value ( $100 ) and interest rate (use .12 = 12%) per year and then figures out how much will be in the account after 4 months and prints results.
Answer:
// here is program in C++.
// include header
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
float ini_sav;
float i_rate;
cout<<"Enter the initial saving:";
// read initial saving
cin>>ini_sav;
cout<<"Enter interest rate:";
// read interest rate
cin>>i_rate;
// account after 4 months
float account=ini_sav+ini_sav*i_rate*(4/float(12));
// print account
cout<<"Account after 4 months:"<<account<<endl;
return 0;
}
Explanation:
Read initial saving from user and assign it to "ini_sav".Then read interest rate and assign to "i_rate".Then calculate the interest on initial saving after 4 months as "ini_sav*i_rate*(4/float(12))" and to initial saving.This will be the account after 4 months.
Output:
Enter the initial saving:100
Enter interest rate:.12
Account after 4 months:104
Which of the following commands contains an error?
Question 2 options:
CREATE vehicletype (carid INTEGER PRIMARY KEY, typeofvehicle TEXT, manufacturer TEXT, year INTEGER);
INSERT INTO vehicletype VALUES (1,"truck","Ford",2000);
SELECT * FROM vehicletype;
Answer:
The very first command contains an error.
Explanation:
The create query is used to create the table in the database. The syntax of the create query is :
create table tablename(column1 datatype,column2 datatype ........columnn datatype);
So there is a keyword table is missing in the given query. so it is incorrect query.
INSERT INTO vehicletype VALUES (1,"truck","Ford",2000); This query is correct.
SELECT * FROM vehicletype; This query is also correct.
What is a 'balanced' dfd?
Answer:
The balanced DFD (Data flow diagram) is the concept of the balancing all the state and incoming and also outgoing flow in the system.
The balanced data flow diagram basically ensure that the output and input data flow maintain the consistency in the DFD and are properly aligned the flow of data.
A balanced DFD does not include any type of flowchart in the control statement and also does not contain any crossing lines.
Answer:
It is how you place an input then you get an output of a graphic
Explanation:
___ should be considered by managers to ensure that newer hardware is compatible with older hardware.
Backward compatibility
Forward compatibility
Integrative compatibility
Reverse compatibility
Answer:
Backward Compatibility
Explanation:
Backward Compatibility means either the Software or Hardware systems which are compatible with the older versions of the software and hardware.It basically means the newer versions of the software or hardware are compatible with the older versions of the same software or hardware.The core technology in both the newer versions and hardware may remain the same. The newer versions uses the same data and technology of the older versions with some upgrades.So, option (A) is correct option.Forward Compatibility is related to the same concept. Forward Compatibility means the older versions of the software and hardware are compatible with the upcoming newer versions of software and hardware. So, option (B) Is wrong option.There are no terms called (C) Integrative Compatibility (D) Reverse compatibility. So, options (C) and (D) are false.What is the output of the code below?
for (int j = 1; j <= 10; j++)
{
if (j == 3)
{
break;
}
cout << j << endl;
}
Output:
for (int j = 1; j <= 10; j++)
{
if (j == 3)
{
continue;
}
cout << j << endl;
}
Output:
Expert
Answer:
The first output for the following code is given below :
1
2
The second output for the following code is given below
1
2
4
5
6
7
8
9
10
Explanation:
In the first code the loop will iterated
When j=1 the condition of if block will not be executed so it print 1 on console and increment the value of j.
After increment of j it becomes 2 again if block does not executed because the condition of if block is not true so it print 2 on console and increased the value of j.
When j=3 if condition block is executed and it terminate the loop immediately .
Therefore output is :
1
2
In the second code the loop will iterate
When j=1 the condition of if block is not executed so it print 1 on console and increment the value of j.
After increment the value of j it becomes 2 .Again if block will not be executed so it print 2 on console and increased the value of j.
After increment the value of j becomes 3.This time if block will executed ,it will moved directly control to the beginning of the loop and skip the current execution of statements that means it skip the value j=3 and increment the value of j .
Now j=4 this process is same follow untill when j<=10 when j=11 the loop is false and loop will terminate .
Therefore output is :
1
2
4
5
6
7
8
9
10
________ is when the sequence of instruction is guaranteed to execute as a group, or not execute at all, having no visible effect on system state.
Answer: Atomic operations
Explanation: Atomic operations are the process in which are related with the programs which execute in the independent manner and having no relation with other processes or functions.
It is helpful operation in the parallel processing system.The operation assures about being carried out at rapid rate and do not face any deadlock during execution.This does not alter the rate of the system.
Write program to calculate the sum of the following series where in is input by user. (1/1 + 1/2 + 1/3 +..... 1/n)
Answer:
#here is code in Python.
#read the value n from user
n=int(input("enter the value of n:"))
#variable to store the total sum
sum_n=0
for i in range(1,n+1):
# find the sum of series
sum_n=sum_n+1/i
#print the sum
print("sum of the series is: ",sum_n)
Explanation:
Read the value of n from user. Create and initialize a variable sum_n with 0. Run a for loop to calculate sum.Initially sum_n is 0, then for value of i=1 1/i will be added to the sum_n.Then in next iteration for i=1, 1/2 added to sum_n. Similarly loop will run util i equals to n.Then sum_n will store the sum of the
series.
Output:
enter the value of n:5
sum of the series is: 2.283333333333333
. Why use a sensitivity analysis?
Answer:
Sensitivity analysis is the method in which it basically predict the final outcome of the decision. It analysis each variable individually and identify the dependency of the output value on the particular value of the input.
The advantage of the sensitivity analysis is that it reduce the overall risk of the particular strategy and also impact of the system.
It basically work on the basic principle that firstly changed the structure and model and then observe the particular behavior of the model.
Register addressing is the fastest way to access memory.
True
False
Answer:
True.
Explanation:
In operating system memory management registers are the fastest way to access memory but their storing capacity is least .They can store data less than 1kb but the access time for register is around 5 ns.
Registers are the smallest unit of memory.The bigger the memory the more is the access time.
Hence the answer to this question is True.
A host is rebooted and you view the IP address that it was assigned. The address is 169.254.141.45. Which of the following happened? (Please select one of the four options)
The host received an APIPA address
The host received a public address
The host receive a multicast address
The host received a private address
Answer: The host received an APIPA address
Explanation:
The IP address 169.254.141.45 is within the range of IP address between 169.254.0.0 and 169.254.255.255, which are reserved by the IANA (Internet Assigned Numbers Authority) for those IP addresses denoted as APIPA addresses, where APIPA stands for Automatic Private IP Address.
This means that any IP Address in this range , will be not be in conflict with routable IP addresses.
write a program to insert student grade and print the following
90 -> A
> 80 -> B
> 70 -> C
> 60 -> D
< 60 -> "Fail"
Answer:
The answer is the program, in the explanation
Explanation:
I am going to write a C program.
int main(){
int grade = -1; /*The grade will be read to this variable*/
/*This loop will keep repeating until a valid grade is inserted*/
while(grade < 0 || grade > 100){
printf("Insert the student's grade: %n");
scanf("%d", &grade);
}
/*The conditional according to the grade value*/
if (grade >= 90){
printf("Your grade is A\n");
}
else if (grade >= 80 && grade < 90){
printf("Your grade is B\n");
}
else if (grade >= 70 && grade < 80){
printf("Your grade is C\n");
}
else if (grade >= 60 && grade < 70){
printf("Your grade is D\n");
}
else{
printf("You got a failling grade\n");
}
return 0;
}
What are design classes? (Points : 6) Design classes are classes whose specifications have been completed to such a degree that they can be implemented.
Design classes are classes whose specifications have been completed to such a degree that they can be programmed.
Design classes are classes whose specifications have been completed to such a degree that they can be approved.
None of these
Answer: implemented
Explanation:I used a bit of deductive logic. Design would be something with parameters and or boundaries like designing a home. Programmed just didn’t seem to fit in because there is no room for creative thinking. Approved? By whom?, you design something to reach a goal and follow to a degree what you designed, maybe within the walls you can add a closet or with design classes they are designed for a purpose but there must be ideas within a design that come up. So implemented makes sense so you have a design that seems to fit and certainly can be implemented meaning it can be used for a purpose to teach or help.
. assures that individuals control or influence what information related to them may be collected and stored and by whom and to whom that information may be disclosed. A. Availability B. System Integrity . Privacy D. Data Integrity
Answer: Privacy
Explanation: Privacy is defined as information or content that is kept to the selected or desired resources and people.It is like a boundary after which the information should not be shared or disclosed because of the privates reasons such as insecurity , protection etc.It is followed for confidential and sensitive content to remain secure and cannot be misused.
Other options are incorrect because availability is referred serviceability of data, system integrity is assuring no unauthorized action in system for modification and data integrity assures about the safeness and reality of information without manipulation .Thus, the correct option is privacy.
Write a recursive function that returns the number of 1 in the binary representation of N. Use the fact that this is equal to the number of 1 in the representation of N/2, plus 1, if N is odd.
Answer:
#here is code in python
# recursive function that counts the number of 1's
def bin_count(num):
#base condition
if num==0:
return (0)
elif num == 1:
return (1)
else:
#recursive call
return bin_count(num//2)+bin_count(num%2)
#read a number
num=int(input("enter a number:"))
#call the function
print("number of 1's is:",bin_count(num))
Explanation:
Read a number from user and call the function bin_count() with parameter num. In the function, if num=0 then it will return 0.If num is 1 then return 1 else it will count the number of 1's inn the binary representation of the number and return the count.
Output:
enter a number:63
number of 1's is: 6
What is memory paging, and how can it facilitate virtual memory?
Answer:
Memory paging is a memory management technique that controls how memory resources are used and shared by the operating system.
The virtual memory is an alternate set of memory addresses that operating systems in conjunction with the hardware reserve to expand the total amount of addresses(real memory + virtual memory). When the program is actually executed, the virtual addresses are converted into real memory addresses.
The operating system divides virtual memory into pages to facilitate copying virtual memory into real memory, each of which contains a fixed number of addresses. When the page is needed, the operating system copies it from disk(virtual memory) to the main memory(real memory), translating the virtual addresses into real addresses.
Why do we have some network devices that have more than one IP address?
Answer:
This is because a device can have more than a network interface.
Explanation:
IP address has to be unique in a network but a device can have more than a network interface. This is because the device has multiple network cards and for each of the interfaces we can set up an unique ip address in a LAN. For example almost all laptops have at least two network interfaces: one is the ethernet interface, we can connect an ethernet cable to this interface. The other one is the WiFi interface, we can connect to internet using this interface. In this case we can have more than one IP address but they have to be unique.
Explain what might happen if two stations are accidentally assigned the same hardware address?
Answer: If two different station are addressed with the same hardware address then there are chances of occurrence of the failure in the network at irregular intervals.The failure or error will occur because of the both the devices are seen as one by the network due to same address.
An intelligent network system id used ,it can identify the error can help in the prevention of the failure.Other option for configuring the situation is assigning the MAC(media access control)address to devices which are unique in nature thus, no device can have same address.
In Mandatory Access Control sensitivity labels attached to object contain what information?
a.The item’s classification
b.The item’s classification and category set
c.The item’s category
d.The item’s need to know
Answer:b)The item’s classification and category set
Explanation: Mandatory access control(MAC) is the security component in the computer system. It is regarding the controlling the access of the operating system by the administrator.The accessing is made limited by the MAC according to the sensitivity of the data .
The authorization for user to access the system is based on this sensitivity level known sensitivity label. The objects contain the information regarding the classification and categories or level of items. Thus, the correct option is option(b).
Which of the following keywords is used to remove a row in a table? (Points : 2) DROP
DELETE
REMOVE
MODIFY
Answer:
DELETE
Explanation:
DELETE keyword is used to remove a row in a table. The actual syntax is as follows:
DELETE from <TableName> where <Condition>;
For example:
DELETE FROM employee where name='Peter';
This will remove employee with the name Peter from the Employee table.
DROP on the other hand is used to delete the entire table without focussing on a particular row.DROP syntax is as follows:
DROP TABLE <TableName>;
-Write a function is_perfect, which accepts a single integer as input. If the input is not positive, the function should return a string "Invalid input." If the input is positive, the function should return True if the input is a perfect number and False otherwise.
Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// function
string is_perfect(int n)
{
// string variables
string str;
// if number is negative
if (n < 0)
{
str="invalid input.";
}
// if number is positive
else
{
int a=sqrt(n);
// if number is perfect square
if((a*a)==n)
{
str="True";
}
// if number is not perfect square
else
{
str="False";
}
}
// return the string
return str;
}
// main function
int main()
{
// variables
int n;
cout<<"enter the number:";
// read the value of n
cin>>n;
// call the function
string value=is_perfect(n);
// print the result
cout<<value<<endl;
return 0;
}
Explanation:
Read a number from user and assign it to variable "n".Then call the function is_perfect() with parameter n.First check whether number is negative or not. If number is negative then return a string "invalid input".If number is positive and perfect square then return a string "True" else return a string "False".
Output:
enter the number:-3
invalid input.
enter the number:5
False
enter the number:16
True
If variable x has value 2 and y has value 1, which values could result from the following Jack expression?
x + 3 * 4 - y
Answer:
The result of the given expression is 13.
Explanation:
Here x and y are the two variable which has value 2 and 1 respectively.
x+3*4-y
Here operator * is more precedence then that + operator so
=2+(3*4)-1
2+12-1 now + operator is more precedence then that - operator so
=(2+12)-1
=(14-1)
=13
Following are the program in C language
#include <stdio.h>// header file
int main() // main function
{
int x=2,y=1; // variable declaration
printf("%d",x+3*4-1); b// final result
return 0;
}
Output:13
Which of the following is not a valid SQL command? (Points : 2) UPDATE acctmanager SET amedate = SYSDATE WHERE amid = 'J500';
UPDATE acctmanager SET amname = UPPER(amname);
UPDATE acctmanager SET amname = UPPER(amname) WHERE amid = 'J500';
UPDATE acctmanager WHERE amid = 'J500';
Answer:
UPDATE acctmanager WHERE amid = 'J500';
Explanation:
The statement written above is not valid SQL statement because there is no SET after UPDATE. Update is always used with SET.If you are updating something then you need to specify the value with which that value should be replaced.
UPDATE acctmanager SET amname = UPPER(amname);
This statement does not contains WHERE clause but it will run all the values of amname column will get updated in the table acctmanager.
Write a program that inputs a series of 10 non-negative numbers and determines and prints the largest of those numbers. Your program should use three variables: Counter - a counter to count to 10 (i.e. to keep track of how many numbers have been input and to determine when all 10 number have been processed) Number - the current number input to the program Largest - the largest number found so far
Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int Counter,largest=-1,Number;
cout<<"enter 10 non-negative numbers:";
// read 10 non-negative Numbers
for(Counter=1;Counter<=10;Counter++)
{
cin>>Number;
if entered number is largest so far
if(Number>largest)
{
// update the largest
largest=Number;
// print the largest
cout<<"largest found so far is: "<<largest<<endl;
}
}
return 0;
}
Explanation:
Declare variables Counter,Number and largest=-1.Here Counter is use to keep count of input number.largest to store the largest input so far.And Number to read inout from user.Find and print largest after each input.
Output:
enter 10 non-negative numbers:24
largest found so far is: 24
12
56
largest found so far is: 56
9
8
67
largest found so far is: 67
33
56
98
largest found so far is: 98
100
largest found so far is: 100
Name and describe the two (2) broad categories of files
What is the Multiple Items tool?
Explanation:
when a form is created in Microsoft Access using the form tool it displays a single record at a time.To display multiple records and the form should be more customizable then in this case we use Multiple Items tool.
Creating a form using Multiple Items Tool:-
In navigation pane click query or table which contains the data that we want to see on the form.
On create tab,in the group Forms,click more Forms,then click Multiple Items.