The logical operators have __________ associativity.
Answer: Logical AND
Explanation:
The logical operator of the associativity is the property that basically determine the similar precedence of the given operator that are group during the lack of the parentheses in the programming language.
The choice of the operator are basically depend upon the operand which is determined by the associativity. In the logical operator the logical AND must have the same precedence level in the associativity.
What is the output of the following program fragment:
void find(int a, int& b, int& c)
{
int temp;
c = a + b;
temp = a;
a = b;
b = 2 * temp;
}
int main()
{
int x, y, z;
x = 10;
y = 20;
z = 25;
find(x, y, z);
cout<< x <<" "<< y <<" "<< z <
return 0;
}
Output:
Answer:
Output of the given code is: 10 20 30.
Explanation:
Here in function find(int a, int& b, int& c), three parameters are passed, firstis passed by value and rest are passed by reference. When a parameter is passed by value, the any changes made by the other function doesn't reflects in the main function.And when a value is passed by reference, then any changes made by other function will reflects in the main function also.
Here find is called with (10,20,25).So in the function, c=a+b i e. c=10+20.Here b,c are passed by reference. So any change in b,c will change the value of y,z in main. temp=10,then a=b i.e a=20, and b=2*temp That is b=2*10.Here value of a=20, b=20 and c=30.Since b,c are passed by reference then it will change the value of y, z in main function but a will not change the value of x.
Hence the value of x=10, y=20 and z =30 after the function call.
A stack grows downward from high memory to low memory.
True
False
Answer:
True.
Explanation:
The direction of growth of the stack is downwards it moves from high memory to low memory. Sometimes the growth of stack is in upward direction but it depends on the compiler but mostly the direction of growth is downwards.When the function calls are made they start from high memory address to low memory address.
Which of the following does not make a good analysis class? (Points : 6) its name reflects its intent
it is crisp and models one specific element
has well define responsibilities
it has high cohesion
it has high coupling
Answer:it has high coupling
Explanation: Coupling is the property in the field of computer program that is defined as the functions ,data and codes of the program are dependent on each other and cannot be changed independently if requires. Thus,high amount of coupling is not considered as good factor due to high interdependence. Loose coupling can be still permitted.
Other options are correct because name of the class should reflect the purpose and well defined responsibilities should be present, modeling of certain component and high cohesion means keeping similar functions togather is also required. So, the only bad factor is high coupling
Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print: 7 9 11 10 10 11 9 7 Hint: Use two for loops. Second loop starts with i = courseGrades.length - 1. (Notes) Note: These activities may test code with different test values. This activity will perform two tests, both with a 4-element array. See "How to Use zyBooks". Also note: If the submitted code tries to access an invalid array element, such as courseGrades[9] for a 4-element array, the test may generate strange results. Or the test may crash and report "Program end never reached", in which case the system doesn't print the test case that caused the reported message.
Answer:
Following are the loop in c language
t = sizeof(courseGrades)/sizeof(courseGrades[0]); // determine the size of array
for(int i=0;i<t;++i) // iterating loop
{
printf("%d ",courseGrades[i]); // print the array in forward direction with space
}
for(int i=t-1;i>=0;--i)// iterating loop
{
printf("%d ",courseGrades[i]); // print the array in backward direction with space
}
Explanation:
In this firstly we find a size of the courseGrades array in variable "t" after that we created a loop for print the courseGrades array in forward direction with space.
finally we created a loop for printing the courseGrades array in backwards direction.
Following are the program in c language :
#include <stdio.h> // header file
int main() // main function
{
int courseGrades[]={7, 9, 11, 10}; // array declaration
int t; // variable t to store the length of the array
t = sizeof(courseGrades)/sizeof(courseGrades[0]); // determine the size of array
for(int i=0;i<t;++i) // iterating loop
{
printf("%d ",courseGrades[i]); //print the array in forward direction with space
}
for(int i=t-1;i>=0;--i) // iterating loop
{
printf("%d ",courseGrades[i]);// // print the array in backward direction with space
}
return 0;
}
Output:
7 9 11 10 10 11 9 7
Final answer:
A forward and backward traversal of an array can be achieved with two separate for loops, printing each element followed by a space and ending each loop with a newline.
Explanation:
Traversing an array both forwards and backwards is a common task in programming, often accomplished using for loops. To print all the elements in an array called courseGrades, first in the original order and then in reverse, two separate for loops can be used. Here is a sample code snippet:
int[] courseGrades = {7, 9, 11, 10};
// Forward traversal
for (int i = 0; i < courseGrades.length; i++) {
System.out.print(courseGrades[i] + " ");
}
System.out.println();
// Backward traversal
for (int i = courseGrades.length - 1; i >= 0; i--) {
System.out.print(courseGrades[i] + " ");
}
System.out.println();
The first for loop initializes the iterator variable i at 0 and iterates until it reaches the length of the array, while the second for loop starts from the end of the array and decrements i until it gets to 0. Both loops print each element followed by a space, concluding with a newline character after the end of each loop.
What do you believe are the motives of a cyber criminal? Why?
Answer:
Cyber criminal is a attacker or the hacker who tends to hack and steal the personal and confidential information present in the computer systems.The hacking process is carried out by the means of installing the malware in the authorized system,manipulation of the system function,etc.
The cyber crime is executed by the hackers with the help of the knowledge about the operating system and hacking techniques. Attacking the system is done by them so that they can have the confidential information, personal information or data that is not to be share or accessed by anyone except for the authorized user.
The hacked data can be manipulated such as eliminating data containing evidence, leaked by sharing confidential data with wrong sources etc by the hacker for their own purpose or other reasons.
Write a JavaScript program that uses a function and a loop to print a list of the days of the week. Use JavaScript.
Answer:
<html>
<body>
<script>
days1(); // calling function days1()
function days1() // function days1
{
var week = ["sunday ", "monday ", "tuesday "," wednesday"," thursday",
"friday"," saturday"];
var i;
for (i=0;i<7;i++) // iterating over the loop
{
document.write(" The number of days in a week :" +</br>);
document.write( week[i] + "</br>" ); // print the number of days
}
}
</script>
</body>
</html>
Output:
The number of days in a week :
sunday
monday
tuesday
wednesday
thursday
friday
saturday
Explanation:
In this program, we create a function days1().In this function, we declared an array i.e " week " which will store the list of the days of the week. After that, we iterate the for loop and prints a list of the days of the week.
how would you define a relational database ?
a. data stored in a table
b. data stored in multiple tables each with a relationship to each other
c. data arranged in a table as rows and columns so data can be extracted at an intersection rather than reading the whole table from beginning to end
d. database design follows the twelve principles proffered bh Dr. Edgar F. Codd
Answer: (D) Database design follows the twelve principles proffered by Dr. Edgar F. Codd
Explanation:
The relational database is basically based on the relational model of the data which is proposed by the Dr Edger F. codd and he mainly introduced the twelve basics principle of the database designing in the database system. He also contributed various valuable principle in the computer science.
The twelve principle are:
The first rule of the relational database is the information rule as it represented all data or informationIndependence of the integrityViewing various updating ruleLogically treatment of various NULL valueIndependence of the physical databaseDistribution in-dependencyVarious delete, insert and update rulesThe overall logical description of the database are basically stored in the database directoryThere is no subversion ruleThere is guarantee accessing ruleProper rule for data language The relational database level actionsDescribe the need for switching and define a switch. List the three traditional switching methods. Which are the most common today? Compare and contrast a circuit switched network and a packet-switched network. (How are they alike and how are they different) What is TSI and what is its role in time-division switches. List four major components of a packet switch and their functions.
Network switching is an essential aspect of computer networking. Interconnecting multiple devices can sometimes cause issues in a network. The idea of network switching comes in when we want to offer practical solutions to these issues. Data coming into an input port (ingress) and data leaving out (egress) to its final destination are always achieved through network switching. A switched network must have a switch that acts as the medium through which data passes to its final destination. It can connect your computers, servers, and printers, creating a way to share resources.
The three main traditional switching techniques are circuit switching, message switching, and packet switching. However, the most common models used today are circuit switching and packet switching. They are used to connect communicating devices together within an enterprise network. Let us learn a little bit more about them. The similarities between these two are very generic. They both would probably require the destination address of the device you are sending the packets to. However, there are several distinct differences between them.
Circuit switching is connection-oriented while packet-switching technology is connectionless. The former is set up as a dedicated communication channel that is established before the sender and recipient can start to communicate. Data on the latter is fragmented into packets routed independently by network devices. The message in Circuit switching is received in the same way it was sent, while message sent as packets in Packet switching is received out of order and assembled upon arriving in its destination.
Inside a Switch’s hardware architecture is a TSI (Time-slot interchange) which is a known technology that uses time-division switching technology with the help of (TDM) time-division multiplexing. It has RAM that comes with several other memory locations and has input and output ports that uses the RAM to fill up with data that comes in through its input terminal. Its mechanism deals with how data comes in through input ports, stored and read out in RAM in sequences, and then sent out through output ports. We will discuss these ports down below
The four components are:
Input Ports – As discussed above, the input ports deal with how data comes in and how it is presented in the physical and data link layers of the OSI
Output Ports – It does the opposite of the functions of an input port
Routing protocol – In the network layer of the OSI, the routing protocol performs the functions of the table lookup. Decisions on the best path are made for network packets .
Switching Fabric – In packet switching, there are input and output line cards that are connected by a switch fabric. Most processing in switching fabrics is done in line cards.
Final answer:
Switching is necessary for routing data in networks, with packet-switched networks being the most common today. Circuit-switched networks dedicate a channel for sessions, while packet-switched networks use small packets for more efficient data transfer. Four major components of a packet switch include Input Ports, Switching Fabric, Output Ports, and Routing Processor.
Explanation:
The need for switching in network architectures arises from the requirement to efficiently route data between multiple endpoints. A switch is a networking device that connects devices together on a computer network, using packet switching to forward data to its destination.
The three traditional switching methods are:
Circuit SwitchingPacket SwitchingMessage SwitchingOf these, packet switching is the most common in contemporary networks.
Comparison of Circuit-Switched and Packet-Switched Networks:
A circuit-switched network establishes a dedicated channel between nodes for the duration of a session. In contrast, a packet-switched network sends data in small packets, each possibly taking different paths to the destination. Both methods aim to facilitate communication, but packet-switched networks are more efficient and reliable, especially in the case of network congestion or failure.
TSI, or Time Slot Interchange, plays a crucial role in time-division switches by dynamically reallocating time slots to different data streams, thus optimizing the use of available bandwidth.
Major Components of a Packet Switch:
Input Ports: Receives packets and performs preliminary processing.Switching Fabric: Connects the input ports to the output ports.Output Ports: Buffers and transmits packets to the next node.Routing Processor: Determines the optimal path for packets.What type of cable would you use to connect two hosts together in a back-to-back configuration using twisted pair cable?
Answer: Straight-through cable.
Explanation: Straight-through cable are the cables that are used for connecting the host and client.It is the type of twisted-pair cable wire which forms the connection the local area network(LAN).This copper wire sis used for the connection of the client devices like printer etc top the hub.
The connection formed through the straight -through cable is made with the RJ-45 connectors having similar conductor(pin) arrangement .Thus, connection of two host back to back is done by straight-through cables.
Final answer:
To connect two hosts directly with a twisted pair cable, a crossover cable is needed, which has the transmit and receive pairs crossed over to enable direct device-to-device communication. While modern network interfaces may auto-sense and negate the need for crossover cables, they remain important for use with older or non-auto-sensing devices.
Explanation:
To connect two hosts directly using a twisted pair cable in a back-to-back configuration, you would use a crossover cable. This type of cable is designed to connect two network devices of the same type, such as two computers, without the need for a switch or hub in between. The crossover cable crosses over the transmit and receive pairs, allowing the devices to communicate directly. Twisted pair cables, such as Cat5e or Cat6, are commonly used for this purpose, with the wiring specifically configured within the RJ45 connectors to enable this direct communication.
For example, in a standard Ethernet cable which is a straight-through cable, the wires are connected identically on both ends. However, for a crossover cable, one end of the cable has the green pair of wires switched with the orange pair, meaning pin 1 becomes pin 3 and pin 2 becomes pin 6 on the other end. This switch allows the transmit (TX) pins on one end to match up to the receive (RX) pins on the other, enabling two network devices to communicate.
Using a crossover cable is less common nowadays with modern network interfaces often including auto-sensing technology that can automatically adjust to communicate over straight-through cables. However, it's still important for compatibility with older equipment or situations where auto-sensing isn't available.
Which MySQLCursor object returns all the rows in a result set?
a
fetchone()
b
fecthsome()
c
fetchmany()
d
fetchall()
Answer:
fetchall()
Explanation:
MySQLCursor object method fetchall() method returns all the rows in the resultset.
For example:
>>> cursor.execute("SELECT * FROM Student ORDER BY rollno")
>>> rows = cursor.fetchall()
Now rows will contain a reference to the results of the query. If the size of the resultset returned by the query is 0 then rows will reference an empty set.
fetchmany() and fetchone() are , on the other hand , used to retrieve many(count specified) or one row from the result respectively.
True / falseIn SQL Server, you can define unlimited INSTEAD OF triggers per INSERT, UPDATE, or DELETE statement.
Answer: False
Explanation: "INSTEAD-OF" is the trigger that is used in SQL server for the execution rather than using the statement of data manipulation .This trigger helps in skipping the the statements like "DELETE", "UPDATE","INSERT" etc.
It can be used for one data manipulation statement corresponding to one trigger in a single table only.Thus ,the statement given in question is false because numerous INSTEAD-OF triggers do not work for each UPDATE,DELETE or INSERT options
2. A room has one door and two windows, and it needs to be painted. Assume that 1 gallon of paint can paint 120 square feet; that the door is 8ft x 5ft and the windows are each 2ft x 3ft. (You will not paint the door or windows.) Write a program called Lab 1-2B to ask the user for the length, width & height of the room; then calculate 1) total square footage of walls to be painted and the 2) amount of paint needed. Then print both values with labels. C#
Answer:
// code in C#.
using System;
class WallPaint {
static void Main()
{
//variables
double l,w,h;
double win_area,door_area;
double amount_gallon;
Console.WriteLine("enter length of room:");
// read the length of room
l= Convert.ToDouble(Console.ReadLine());
Console.WriteLine("enter width of room:");
// read the width of room
w= Convert.ToDouble(Console.ReadLine());
Console.WriteLine("enter height of room:");
// read the height of room
h= Convert.ToDouble(Console.ReadLine());
Console.WriteLine("enter amount of a gallon:");
// read the amount of a gallon
amount_gallon= Convert.ToDouble(Console.ReadLine());
// find the area of both window
win_area=2*(2*3);
// area of door
door_area=8*5;
// total area of all walls
double tot_room_area=2*(l*h)+2*(w*h);
// area to be painted
double paint_area=tot_room_area-(win_area+door_area);
// gallos of paint required
double no_gallon=paint_area/120;
// total amount of paint
double tot_amount=no_gallon*amount_gallon;
// print the area to be painted
Console.WriteLine("total square footage of walls to be painted : "+paint_area);
// print amount of paint
Console.WriteLine("total amount of paint is: "+tot_amount);
}
}
Explanation:
Read the length, width and height of the room from user.Read the amount of paint per gallon from user.Calculate the total area of all the walls.Calculate the area or window and door.Then find the area to be painted by subtracting window and door area from total wall area.Then find the number of gallon of paint required to paint all the area.Then calculate the total amount of the paint.
Output:
enter length of room:
10
enter width of room:
8
enter height of room:
12
enter amount of a gallon:
15
total square footage of walls to be painted : 380
total amount of paint is: 47.5
This detailed guide explains how to calculate the total square footage of walls to be painted and the required amount of paint using a C# program. It covers how to account for the dimensions of a room, door, and windows, and then converting these into an area to be painted. This procedure is carried out step-by-step in the following C# code example.
To determine the total square footage of walls to be painted and amount of paint needed, we'll write a C# program. The program will:
Ask the user for the length, width, and height of the room.Calculate the total square footage of the walls by subtracting the area of the door and windows from the overall area of the wall.Based on the area that needs to be painted and the paint's coverage capabilities, calculate the required amount of paint.Here is a step-by-step example in C#:using System;Assuming you have correctly entered the dimensions, this program calculates the total square footage to be painted and the amount of paint needed accurately.
Write a program that reads an integer, and then prints the sum of the even and odd integers.
Answer:
#include <iostream> // header file
using namespace std; // namespace
int main ()
{
int n, x1, i=0,odd_Sum = 0, even_Sum = 0; // variable declaration
cout << "Enter the number of terms you want: ";
cin >> n; // user input the terms
cout << "Enter your values:" << endl;
while (i<n) // iterating over the loop
{
cin >> x1; // input the value
if(x1 % 2 == 0) // check if number is even
{
even_Sum = even_Sum+x1; // calculate sum of even number
}
else
{
odd_Sum += x1; // calculate sum of odd number.
}
i++;
}
cout << "Sum of Even Numbers is: " << even_Sum << endl; // display the sum of even number
cout << "Sum of Odd Numbers is: " << odd_Sum << endl; // display the sum of odd number
return 0;
}
Output:
Enter the number of terms you want:3
Enter your values:2
1
78
Sum of Even Numbers is:80
Sum of Odd Numbers is:1
Explanation:
In this program we enter the number of terms by user .After that iterating over the loop less then the number of terms .
Taking input from user in loop and check the condition of even. If condition is true then adding the sum of even number otherwise adding the sum of odd number.
Finally print the the sum of the even number and odd integers.
Explain the difference between single-bit errors and burst errors in error control in communications systems. (3 marks)
(a) If a noise event causes a burst error to occur that lasts for 0.1 ms (millisecond) and data is being transmitted at 100Mbps, how many data bits will be affected? (3 marks)
(b) Under what circumstances is the use of parity bits an appropriate error control technique?
Answer: a) Single-bit errors: It affects only one bit in a symbol.
Burst errors: It affects to several sequential bits in a given
symbol
b) 10000 bits.
c) When the most typical error is a single bit error.
Explanation: a) It is explained in the answer.
b) If data is being transmitted at 100 Mbps, this means that in 1 second, 100x 10e6 bits are transmitted, and that one single bit lasts for 10e-8 sec.
So, if the noise event that causes the burst error lasts 0.1 msec, this means 10e-4 sec.
Number of bits in error= 10e-4/10e-8= 10e4 bits= 10000 bits.
c) If the error is in a single bit in a symbol, this means that if the right number of 1s is even, a single error will change this number to an odd number , and the error could be easily detected.
Final answer:
Single-bit errors affect one bit, while burst errors affect a sequence of adjacent bits. For the 0.1ms burst error at 100Mbps, 10,000 bits are affected. Parity bits are suitable for low error rates and simple error detection needs.
Explanation:
The difference between single-bit errors and burst errors in error control in communications systems is that a single-bit error affects only one bit within a data stream, meaning only one bit has been altered from a zero to a one, or vice versa. In contrast, burst errors affect a sequence of adjacent bits in the data stream, which can be due to noise, fading, or other issues with the communication channel.
(a) For a noise event that causes a burst error to occur lasting for 0.1 ms (milliseconds) with a data transmission rate of 100 Mbps (megabits per second), the number of affected data bits can be calculated by multiplying the duration of the noise event by the transmission rate. This results in 0.1 ms * 100 Mbps = 0.1 * 10−6 * 100 * 106 = 10,000 bits affected.
(b) The use of parity bits is an appropriate error control technique when the error rate is low, and simple error detection is required, such as in scenarios where the cost of additional complex error correction measures is not justified or the communication channel is reliable enough that only rare error detection is needed.
A 40 fps(frames per second) video clip at 5 megapixels per frame would generate large amount of pixels equivalent to a speed of
4800
200
600
2400
Answer:
Speed will be 200 so option (b) will be correct option
Explanation:
We have given a 40 fps ( frame per second ) video clip at 5 megapixels per second
We have to find the speed
Speed is given by fps ( frame per second × mega pixel per frame )
As in the question it is given that video clip has 40 fps ( frames per second ) at 5 megapixels per frame
So speed [tex]=40\times 5=200[/tex]
So option b will be correct option
What should you do if you forget your root password for MySQL?
(a) Go to get a root canal.
(b) You have to re-install MySQL with a new password.
(c) You better hope you wrote it on a Post-It, because there is no way to recover or change the password.
(d) Call the GeekSquad to help.
(e) In Linux you can run MySQL in 'safe mode' (which doesn't require a password to login) to reset your password.
Answer:
E) in linux you can run MySQL in 'safe mode' (which doesn't require a password to login) to reset your password.
Answer:
(e) In Linux you can run MySQL in 'safe mode' (which doesn't require a password to login) to reset your password.
Explanation:
Which of the following would be the most appropriate choice for a method in a Cylinder class? (Points : 5) InputRadius()
Volume()
Radius()
Area()
Answer: Volume()
Explanation: As the class name is mentioned as the Cylinder class() , it can be easily predicted that the dimension of the cylinder is mentioned in the class .The cylinder in general is the round figure that has top and bottom to enclose it. So ,Volume() is the most appropriate function related with cylinder .
Other options are incorrect because radius() function is for the determining of the radius and area() function is for area determination of cylinder ,which are used in the volume calculation .Thus the correct option is Volume() which requires both area and radius for the cylinder.
In what cases would you denormalize tables in your database?
Answer: Denormalize is the mechanism is carried out by addition of the redundant bits in the already normalized database.The data is attached in the form of attributes,adding new tables.
This technique is used in the case of previously normalized data collection which requires improvement in the performance by reducing the errors.The improvement is made by making database readable ,adding group of data in redundant form etc.
When data is to be retrieved quickly then also denormalization is used as by grouping or collecting information into a single table.
Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr
Answer:
DNA obj =new DNA;//obj object created dynamically.
DNA *dnaPtr=&obj.//dnaPtr to store the address of the object.
Explanation:
The above written statements are in C++.The DNA object is created dynamically and it is done in C++ by using new keyword which allocates the heap memory for the object.
Then a dnaPtr is created of type DNA so that it can store the address of the DNA objects.
An expression containing the operator && is true either or both of its operands are true. True/False
Answer:
True.
Explanation:
An expression containing the && and operator is only true if both of the operands present in the expression are true otherwise it will give the result as false if either one of them is false or both of them are false.In the question it states that the expression in true either or both of it's operand are true.
Hence the answer is true.
) Object-oriented programming generally does NOT focus on _____. (Points : 5) A. separating the interface from the implementation
B. client side access to implementation details
C. information hiding
D. ease of program modifiability
All of the above
None of the above
Only A, C, and D
Answer: Only A, C, and D
Explanation: Object -oriented programming(OOP) is the programming concept that has data types and functions that are applicable on the data structure.The basic features displayed by the OOPs concepts is encapsulation, polymorphism,abstraction,implementation data etc.
OOPs concept does not consider the factors like hiding of data ,modification factor and separating of interface. Thus option A ,C and D are only options that are not focused by OOPs.
Differentiate between morals and ethics. (2.5 Marks)
Answer:
Ethics is the branch of the moral philosophy and basically refers to the rules that is provided by the external source. Ethics is the standard principle and value that is used by the individual decisions and actions.
Organizational ethics is very important in an organization so that they can govern the employee ethics and value towards their organization. Honesty, fair are the main principles of the ethics.
Morals basically refers to the individual's principle regarding the wrong and right decision making.
Morals in the organization is the is the consistency of the individual manner, standard and it basically guide the basic values in the organization.
What is the difference between the default constructor and the overloaded constructor?
Explanation:
A default constructor is a constructor that present in the class by default with no parameters when we write a new constructor with parameters it is called overloaded constructor.There can be different overloaded constructors in the same class.
The main difference between default constructor and overloaded constructor is that the default constructor does't have any parameters while the overloaded constructors have parameters.
The default constructor takes no arguments and provides standard initialization, while the overloaded constructor has parameters and allows for objects to be initialized with specific values. Both constructors are essential in object-oriented programming for creating and initializing objects.
In object-oriented programming, constructors are special methods used to initialize objects. There are two main types of constructors: the default constructor and the overloaded constructor.
Default ConstructorA default constructor is a constructor that takes no arguments. If no constructors are explicitly defined in a class, Java (for example) automatically provides a default constructor, which initializes objects with default values. For instance:
public class Example {
public Example() {
// Default constructor
}
}
An overloaded constructor, on the other hand, has parameters and allows for the creation of objects with specific values. Overloading provides flexibility and the ability to initialize objects in various ways. Here’s an example:
public class Example {
public Example() {
// Default constructor
}
public Example(int value) {
this.value = value;
// Overloaded constructor
}
}
Key Differences
The default constructor has no parameters, whereas an overloaded constructor has one or more parameters.The default constructor initializes objects with standard default values, while an overloaded constructor can initialize objects with user-defined values.What can you say about the following Java class definition?
public class MyApp extends JFrame implements ActionListener {
Answer:
The class is called MyApp which inherits from JFrame and implements the ActionListener interface.
Explanation:
The class is called MyApp which extends the swing class JFrame and implements the ActionListener interface for event handling. As a results it needs to implement a method called actionPerformed for handling the relevant events that may be raised from the user interface. Since it extends JFrame, it has access to all the public and protected methods defined in JFrame(for example setTitle to set the title of the frame).
The Java class definition 'public class MyApp extends JFrame implements ActionListener' shows that MyApp is a public class extending JFrame and implementing ActionListener. This means it inherits from JFrame and must provide the actionPerformed method. An example demonstrates adding a button to the JFrame and handling button clicks.
The given Java class definition public class MyApp extends JFrame implements ActionListener indicates several important things:
public class: The class MyApp is public, meaning it can be accessed from other classes.extends JFrame: The class MyApp is a subclass of JFrame, which means it inherits properties and methods from the JFrame class. JFrame is part of the Java Swing library used for creating graphical user interfaces.implements ActionListener: The class MyApp implements the ActionListener interface. This means MyApp must provide an implementation for the actionPerformed method defined in the ActionListener interface. This method is typically used to handle events, such as button clicks.Here’s a simple example to illustrate:
import javax.swing.*;In this example, a button is added to the JFrame, and when clicked, the actionPerformed method is triggered, printing a message to the console.
what are the similarities between data mining and data analytics
Answer:
The similarities between the data analysis and data mining is that both are the subset of the BI (Business intelligence) that involve in the database management system and data warehousing.
Data mining is the process in which the raw data is basically organize in many different patterns by using the various computational methods. It is basically used to generate the new data or information.
Data analytics is also define various facts in the specific data by using various techniques such as business intelligence and analytics.
These both technologies are basically used in the CRM (Customer relationship management) for analyzing the specific patterns and various customer database.
_ is the adherence to a personal code of principles.
Ethics
Morality
Integrity
Honesty
Section B
Answer: Ethics
Explanation:
Ethics is the basic principle for the personal code. The code of the ethics is basically designed for outline the values in the organization with honesty and integrity.
The ethics is basically depend upon the principle of core value of the organization. The code of the ethics basically guide the core value in the organization and breaking the rule of ethics can also cause termination from the organization.
Morality, integrity and honesty are all the sub part of the ethics vale in the organization. Therefore, ethics is the correct option.
A class is designed with two public attributes: attributeOne and attributeTwo. attributeOne is an integer data type while attributeTwo is a string data type. Which pseudocode representation(s) of setters would be appropriate for this class? (Points : 5) A. int setAttributeOne(int newAttributeOne)
{
return attributeOne
}
B. void setAttributeOne(int newAttributeOne)
{
attributeOne = newAttributeOne
}
C. string setAttributeTwo (int newAttributeTwo)
{
attributeTwo = newAttributeTwo
}
D. void setAttributeTwo ()
{
attributeTwo =
Answer:
B. void setAttributeOne(int newAttributeOne)
{
attributeOne = newAttributeOne
}
Explanation:
The class has two public attributes : int attributeOne and String attributeTwo.
The appropriate setters for these attributes will be as follows:
void setAttributeOne(int newAttributeOne)
{
attributeOne = newAttributeOne ;
}
void setAttributeTwo(int newAttributeTwo)
{
attributeTwo = newAttributeTwo;
}
The highlighted code corresponds to option B among the given options. So option B is the correct setter for attributeOne.
. A possible data for source that could be used when completing a mail merge could be a(n)… : *
a. Excel worksheet
b. Outlook contacts list
c. Access database table
d. all the above
Answer: d) All of the above
Explanation: Mail merge is the technique in which the emails are combined with the predefined labels so that it could be mass mailed. This tool is helpful for sending a mail to several people at one time. Data source that is used in the mass mailing is known as the database that holds a column for variables present in templates.
Therefore, outlook contact list, excel sheet access database table,word table etc can be used as the source of data at the time of mail merge.These tools acts as data source to connect with the templates.Data source is the source that contains the information about the recipient such as address etc.
Thus all the options mention in the question are correct.
A possible data for source that could be used when completing a mail merge could be all the above.
d. all the above
Explanation:
Mail merge allows one to send a particular document to different individuals.
It is generally used in office environment where some information is to be communicated to a number of people. The information is attached by adding the data sources.
The information source is a report, spreadsheet or database that contains customized data, for example, names, locations, and telephone numbers.
- Define file format or protocol.
Answer:
File format:
The file format basically describe the main structure of the data. It is the standard way for designing the different types of data in very particular file format. The information is basically encoded in the computer file as storage.
There are different types of file format such as:
Word documentWeb page imageAdobe post script fileMultimedia fileProtocol is basically define the proper procedure for handling the different types of the data in he database. It is the set of guideline and rules are are specifically used in communication in the form of data or information.