create a C program to read 3 unique(integer) numbers, find the largest and smallest numbers and print them to the screen. if the numbers are not unique, your program should print an appropriate message and exit. Otherwise, it should identify the smallest and largest numbers and print them to the screen.

Answers

Answer 1

Answer:

// here is code in C

#include <stdio.h>

// main function

int main(void) {

// variables

int a,b,c;

int mx,mn;

printf("Enter three numbers: ");

 // read the 3 numbers

scanf("%d %d %d",&a,&b,&c);

 // if all are not different

if(a==b||a==c||b==c)

{

    printf("all numbers are not different:");

}

// find the largest

else{

    if(a>b)

    {

        if(a>c)

        mx=a;

        else

        mx=c;

    }

    else{

        if(b>c)

        mx=b;

        else

        mx=c;

    }

// find the smallest

    if(a<b)

    {

        if(a<c)

        mn=a;

        else

        mn=c;

    }

    else{

        if(b<c)

        mn=b;

        else

        mn=c;

    }

}

// print largest and smallest

printf("largest of all is: %d \n",mx);

printf("smallest of all is: %d",mn);

return 0;

}

Explanation:

Read three numbers and assign them to variables "a","b" and "c" respectively. Check if all the numbers are different or not.If all are not different then print message "all are not different.".Otherwise find the largest and assign to "mx" and then find the smallest and assign to "mn".Print the largest and smallest of all three.

Output:

Enter three numbers:5 2 9

largest of all is: 9

smallest of all is: 2


Related Questions

True / falseIn SQL Server, you can define unlimited INSTEAD OF triggers per INSERT, UPDATE, or DELETE statement.

Answers

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

_ is the adherence to a personal code of principles.

Ethics
Morality
Integrity
Honesty
Section B

Answers

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.  

In what cases would you denormalize tables in your database?

Answers

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.

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.

Answers

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:

Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr

Answers

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.

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#

Answers

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;

class Program
{
   static void Main()
   {
       // Variables for room dimensions
       Console.Write("Enter the room's length in feet: ");
       double length = Convert.ToDouble(Console.ReadLine());
       Console.Write("Enter the room's width (in feet): ");
       double width = Convert.ToDouble(Console.ReadLine());
       Console.Write("Enter height of the room (in feet): ");
       double height = Convert.ToDouble(Console.ReadLine());

       // Calculate total wall area
       double totalWallArea = 2 * height * (length + width);

       // Area of door
       double doorArea = 8 * 5;

       // Area of two windows
       double windowArea = 2 * (2 * 3);

       // Net wall area to be painted
       double paintableArea = totalWallArea - doorArea - windowArea;

       // Amount of paint needed
       double paintNeeded = paintableArea / 120;

       // Display result
       Console.WriteLine($"Total square footage to be painted: {paintableArea} sq ft");
       Console.WriteLine($"Amount of paint needed: {paintNeeded} gallons");
   }
}

Assuming you have correctly entered the dimensions, this program calculates the total square footage to be painted and the amount of paint needed accurately.

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 =

Answers

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.

what are the similarities between data mining and data analytics

Answers

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.

Differentiate between morals and ethics. (2.5 Marks)

Answers

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.

In PumaMart system, why an initial offer is not necessary at the beginning of negotiation?

Answers

Answer:

 The modification factor decides each progression of property changed in the procedure of the negotiation. In the event that the progression is pretty much nothing, the client can't show signs of improvement arrangement result inside as far as possible.

In the specific arrangement of the negotiation round, if the half shops dismiss the new offering that is propose by the client specialist just because, it implies it is unreasonably forceful for the e-shops. The shopper will keep up the negotiation with "littler" change factors.

In many cases, the e-shop keeper accept the given offer and then, the negotiation agent built a big factor of adjustment.

What is your understanding of the difference between a stream cipher and a block cipher?

Answers

Answer:

In a stream cipher, the information is ciphered byte-by-byte.

In a block cipher, the information is ciphered block by block.

Explanation:

Suppose I have the following text:

Buffalo Bills New England Patriots

New York Jets Miami Dolphins

Each line is one byte, so, on the stream cipher, i am going to apply the ciphering algorithm on:

The letter B

The letter u

The letter f

Until

The letter s(of Miami Dolphins)

Now for the block cipher, i am saying that each line is a block, so the algorithm is going to be applied.

First on: Buffalo Bills New England Patriots

Then: New York Jets Miami Dolphins

Final answer:

A stream cipher processes input data bit by bit or byte by byte, generating a stream of encrypted output. A block cipher divides input data into fixed-length blocks and encrypts each block separately using a fixed encryption algorithm and a secret key.

Explanation:

A stream cipher and a block cipher are two different encryption techniques used in computer cryptography. The main difference between them lies in the way they encrypt data. A stream cipher processes the input message bit by bit or byte by byte, generating a stream of encrypted output. This stream is combined with the plaintext using a bitwise operation such as XOR to produce the ciphertext. Stream ciphers are typically used for real-time applications or when individual bits need to be encrypted and decrypted.

On the other hand, a block cipher divides the input message into fixed-length blocks, usually 64 or 128 bits, and encrypts each block separately. The blocks are encrypted using a fixed encryption algorithm and a secret key. Block ciphers are commonly used for securely encrypting large amounts of data in a fixed block size.

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.

Answers

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.

Write a void function using two type int call-by-reference parameters that swaps the values in the arguments. Be sure to include testable pre and post conditions. .

Answers

Answer:

Please copy the C++ code inluded. It's better to open it with an Integrated Development Environment of your choice.

Th C++ code includes explanatory comments (after "//"). You may run it on on step by step basis.

The void function code follows:

void swapFunction(int & a, int & b) {    // receives 2 references (&) as  a and b

int c = a;                                  // saves a's value (actually first's) to local variable c

a = b;                                      // assigns b's value (actually second's) to a (actually first's)

b = c;                                      // assigns to b (actually second) from c

}

Main function:

using namespace std;                        // Assumes "std::" prefix for "cin" and "cout"    

int main() {                                // Main program unit

int first,second;                           // We must declare 2 variables to store 2 int values (data input)

cout << "First value:"; cin >> first;       // Reads first value after a little message

cout << "Second value:"; cin >> second;     // Reads second value after a little message

swapFunction(first,second);                 // Swap function call sends first's and second's references

cout << "First value:" << first << endl;    // Displays new first value

cout << "Second value:" << second << endl;  // Displays new second value

return 0;                                   // Success exit returns 0

}

Explanation: The testable code is included as main functionIt declares 2 int variables to store input dataReads the input dataCalls swapFunction to swap values storedDisplays exchanged values

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:

Answers

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.

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

Answers

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

An expression containing the operator && is true either or both of its operands are true. True/False

Answers

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.

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

Answers

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

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

Answers

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 actions

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?

Answers

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.

- Define file format or protocol.

Answers

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 file

Protocol 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.

A potential problem related to the physical installation of the Iris Scanner in regards to the usage of the iris pattern within a biometric system is:

a.Concern that the laser beam may cause eye damage.

b.The iris pattern changes as a person grows older.

c.There is a relatively high rate of false accepts.

d.The optical unit must be positioned so that the sun does not shine into the aperture.

Answers

Answer: d)The optical unit must be positioned so that the sun does not shine into the aperture.

Explanation: Iris scanner is the capturing and scanning of the unique iris pattern that is present in small colored circle in the human eye.This techniques works through the invisible infrared light which captures the distinctive pattern.This is usually not visible from the naked eyes.

While scanning the iris through infrared light for image creation, sunlight can interrupt the aperture if it is positioned towards the direct light of sun.

Other options are incorrect because laser beam usually does not damage the eye in most cases,change in pattern in iris is rarely change over time and it has good rate of acceptance.Thus the correct option is option(d).

Write a program that reads an integer, and then prints the sum of the even and odd integers.

Answers

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.

What is the difference between a bound control and an unbound control?

Answers

Answer: The differences between the unbound and the bound control are as follows:-

An unbound control is the control which has data source in field whereas bound control field's contain the data source.The components displayed by the unbound control are pictures, data, line etc. while numbers , text etc are displayed with the help of bound control.The values in the unbound control is not obtained from field but the values in the bound control is gained from the field or expression.

What can you say about the following Java class definition?

public class MyApp extends JFrame implements ActionListener {

Answers

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.*;
import java.awt.event.*;
public class MyApp extends JFrame implements ActionListener {
   JButton button;
   public MyApp() {
       button = new JButton("Click Me");
       button.addActionListener(this);
       add(button);
       setSize(300, 200);
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       setVisible(true);
   }
   public void actionPerformed(ActionEvent e) {
       System.out.println("Button Clicked");
   }
   public static void main(String[] args) {
       new MyApp();
   }
}

In this example, a button is added to the JFrame, and when clicked, the actionPerformed method is triggered, printing a message to the console.

Which MySQLCursor object returns all the rows in a result set?

a

fetchone()

b

fecthsome()

c

fetchmany()

d

fetchall()

Answers

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.

What do you believe are the motives of a cyber criminal? Why?

Answers

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.

The logical operators have __________ associativity.

Answers

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.

Write a JavaScript program that uses a function and a loop to print a list of the days of the week. Use JavaScript.

Answers

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.

in c++, what happends when i add 1 to the RAND_MAX then take rand() deivded by (RAND_MAX+1)?if my purpose is to take out a random number within 0=< and =<1?

Answers

Explanation:

rand() function is used to generate random integers between the range 0 to RAND_MAX.So if we divide the the rand() function by RAND_MAX the value returned will be 0.

You cannot do RAND_MAX + 1 the compiler will give error integer overflown.

To generate an integer with a range.You have to do like this:

srand(time(0));

int a=-1*(rand() % (0 - 5245621) +1);

cout <<a;

This piece of code will return an integer within the range 0 to -5245622.

Describe 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.

Answers

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 Switching

Of 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.
Other Questions
The Control Schedule process to ______________ completion of project work in a timely manner. What conclusion can be drawn about Juliet based on her response to Romeo's banishment? PLEASE HELP due 15 mins!Conjuguer les verbes entre parenthses au Prsent (Verbes rguliers -er / -ir / -re)Question 1 tu (prparer) ton sac dos pour lcole ?Question 2 Ils (jouer) au foot aprs lcole.Question 3 A quelle heure est-ce que ta mre (rentrer) le soir ?Question 4 Nous (tudier) beaucoup pour l'examen de maths.Question 5 Michelle (finir) les devoirs la bibliothque.Question 6 Je (russir) bien dans le cours de Franais.Question 7 Mes frres (choisir) de faire des activits en plein air.Question 8Vous (perdre) souvent vos cls ?Question 9 J' (attendre) le bus pour aller lcole.Question 10 1Brian (rpondre) toujours aux questions du prof. 1. The bottom of an elevated water tank has anarea of 135 m. If the pressure on the bottom is1.52 x 104 Pa, what is the total force the bottommust support? Write a paragraph in Spanish that describes your family. Mention each person in your family and tell about physicalcharacteristics and personality.1UPLOADWRITER The charge per unit length on a long, straight filament is -92.0 C/m. Find the electric field 10.0 cm above the filament. A statement about life, or a central idea, or a moral describes what aspect of a play? The epicardium A. covers the surface of the heart. B. lines the walls of the ventricles. C. is known as the fibrous pericardium. D. attaches inferiorly to the diaphragm.E. is also called endocardium. What is the longest and tallest mountain system in the world? A. Karakoram Range B. Hindu Kush C. Himalayas D. Zagros Mountains An airline manufacturer incurred the following costs last month (in thousands of dollars):a. Airplane seats . . . . . . . . . . . . . . . . . . . . . . . . . $220b. Production supervisors' salaries . . . . . . . . . . . . . . $170c. Depreciation on forklifts . . . . . . . . . . . . . . . . . . . . $110d. Machine lubricants . . . . . . . . . . . . . . . . . . . . . $35e. Factory janitors' wages . . . . . . . . . . . . . . . . . . . . . $60f. Assembly workers' wages . . . . . . . . . . . . . . . . . . . $600g. Property tax on corporate marketing office . . . . . $25h. Plant utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $160i. Cost of warranty repairs . . . . . . . . . . . . . . . . . . . . $230j. Machine operators' health insurance . . . . . . . . . . $40k. Depreciation on administrative offices . . . . . . . . . $60l. Cost of designing new plant layout . . . . . . . . . . . . $165m. Jet engines . . . . . . . . . . . . . . . . . . . . . . . . . . . $1,700Requirement1. Assuming the cost object is an airplane, classify each cost as one of the following: direct material (DM), direct labor (DL), indirect labor (IL), indirect materials (IM), other manufacturing overhead (other MOH), or period cost. What is the total for each type of cost? (Enter amounts in thousands instead of dollars by omitting the $000s. Leave cells blank that do not require numerical inputs.) DM DL IM IL MOH Perioda. Airplane seats . . . . . . . . . . . . . . . b. Production supervisors' salaries . c. Depreciation on forklifts . . . . . . . . d. Machine lubricants . . . . . . . . . . . e. Factory janitors' wages . . . . . . . . f. Assembly workers' wages . . . . . . A red train traveling at 72km/h and a green train traveling at 144km/h are headed towards each other along a straight, level track. When they are 950m apart, each engineer sees the other's train and applies the breaks. The breaks slow each train at the rate of 1.0m/s^2. is there a collision? if so, give the speed of the red train and the speed of the green train at impact, respectively. If not, give the separation between the trains when they stop. A rectangle has a length of 8.3cm and a perimeter of 22.4cm For each of the motions described below, determine the algebraic sign (+, -, or 0) of the velocity and acceleration of the object at the time specified. For all of the motions, the positive y axis is upward. Part A An elevator is moving downward when someone presses the emergency stop button. The elevator comes to rest a short time later. Give the signs for the velocity and the acceleration of the elevator after the button has been pressed but before the elevator has stopped. Enter the correct sign for the elevator's velocity and the correct sign for the elevator's acceleration, separated by a comma. For example, if you think that the velocity is positive and the acceleration is negative, then you would enter +,- . If you think that both are zero, then you would enter 0,0 . Part B A child throws a baseball directly upward. What are the signs of the velocity and acceleration of the ball immediately after the ball leaves the child's hand? Enter the correct sign for the baseball's velocity and the correct sign for the baseball's acceleration, separated by a comma. For example, if you think that the velocity is positive and the acceleration is negative, then you would enter +,- . If you think that both are zero, then you would enter 0,0 . Part C A child throws a baseball directly upward. What are the signs of the velocity and acceleration of the ball at the very top of the ball's motion (i.e., the point of maximum height)? Enter the correct sign for the baseball's velocity and the correct sign for the baseball's acceleration, separated by a comma. For example, if you think that the velocity is positive and the acceleration is negative, then you would enter +,- . If you think that both are zero, then you would enter 0,0 . Which of the following involves a change in behavior resulting from the persons expectation of change rather than from the experimental manipulation itself? a) Cross-generational effect b) Double-blind control c) Placebo effect d) Cohort effect Order the values from least to greatest.30. 8,|3|, -5,1 -2], -232. 12,1-26], -15,|-12, 10| Albino rabbits (lacking pigment) are homozygous for the recessive c allele (C allows pigment formation). Rabbits homozygous for the recessive b allele make brown pigment, while those with at least one copy of B make black pigment. True-breeding brown rabbits were crossed to albinos, which were BB. F1 rabbits, which were all black, were crossed to the double recessive (bb cc). The progeny obtained were 34 black, 66 brown, and 100 albino. a. What phenotypic proportions would have been expected if the b and c loci were unlinked? b. How far apart are the two loci? Carlin Company, which uses net present value to analyze investments, requires a 10% minimum rate of return. A staff assistant recently calculated a $500,000 machine's net present value to be $86,400, excluding the impact of straight-line depreciation. FV of 1 (i=10%, n=5): 1.611 FV of a series of $1 cash flows (i=10%, n=5): 6.105 PV of $1 (i=10%; n = 5): 0.621 PV of a series of $1 cash flows (i=10%, n=5): 3.791 If Carlin ignores income taxes and the machine is expected to have a five-year service life, the correct net present value of the machine would be: A +1.0 nC charge is at x = 0 cm, a -1.0 nC charge is at x = 1.0 cm and a 4.0 nC at x= 2 cm. What is the electric potential energy of the group of charges ? Fred who is a Colts Fan paid $75 for a ticket to go to a Football game. He also spent an additional $30 for parking and bought dinner for $10. Fred took four hours off from a part time job that pays him $10 an hour to go to the game. Freds opportunity cost of going to the game is (A) $155(B) $145(C) $105(D) $75(E) $135 Use the work-energy theorem to determine the force required to stop a 1000 kg car moving at a speed of 20.0 m/s if there is a distance of 45.0 m in which to stop it.