Regarding enumerations, the ____ method returns an array of the enumerated constants.

a.
values

b.
valueOf

c.
toArray

d.
ordinal

Answers

Answer 1

Answer:

a. values

Explanation:

The values() method returns an array of all values of an enumeration. This method is defined automatically by the java compiler for the enum data type.

For example:

enum Traffic_Signal {RED,YELLOW,GREEN};

for(Traffic_Signal t : Traffic_Signal.values()){

   System.out.println(t);

}

This code segment will print out all the valid values in the Traffic_Signal enumeration.


Related Questions

A local variable that is declared as ____ causes the program to keep the variable and its latest value even when the function that declared it is through executing.
A) auto
B) static
C) extern
D) register

Answers

Answer:

A local variable that is declared as Static causes the program to keep the variable and its latest value even when the function that declared it is through executing.

Appreciate with dumbsup and need short discription about what is java programming

Answers

Answer:

java programming language is a programming language which is based on the concepts of object oriented programming.

Explanation:

Java program uses the concept of classes and enable to use the classes by making objects of them. Java program is similar in concepts to that of C++. java program can run on a single system or can also be shared across a network. It is considered to be safe and it is interpreted by JVM (Java virtual machine). Some of its characteristics are it exhibits polymorphism, inheritance and overloading and overriding functions.

Java is used for developing many web based application, software's and games. These program are easy to write, debug and compile with perfect GUIs for which it is considered to be user friendly.

The size of selcetor registor in protectedmode is
a.32 bits, b. 24 bits,c. 16 bit, d.none of these option

Answers

Answer: c) 16 bits

Explanation: Protected mode is the mode which works when the phase of CPU of an operating system which allows to use the virtual memory of the system. It is different from the real world mode and has the codes of 32 bit or 16 bits. For the protected mode ,the size the selector register becomes of 16 bits.When you enter any 16 bit value , it get into the selector register.

Given the following code, what is the final value of i at the end of the program? int i; for(i=0; i<=4;i++) { cout << i << endl; }

Question 5 pow(2,3) is the same as pow(3,2). Question 14 options: True False

Question 6 The functions pow(), sqrt(), and fabs() are found in which include file?

cstdlib

cmath

iostream

regular

Answers

Answer:

The final value of i will be 5 at the end of the program.

i=0, i≤4, prints 0.

i=1, i≤4, prints 1.

i=2, i≤4, prints 2.

i=3, i≤4, prints 3.

i=4, i ≤ 4, prints 4.

i=5, i is not ≤ 4, stops here.

Q-5:

pow(2,3) = 8 and pow(3,2)=9, so they are not same.

Q-6:

The functions pow(), sqrt(), and fabs() are found in which cmath

Explanation:

Final answer:

The final value of i is 5. pow(2,3) is not the same as pow(3,2). The functions pow(), sqrt(), and fabs() are located in the cmath include file.

Explanation:

Final Value of Variable i

The final value of i at the end of the loop in the C++ code is 5. This occurs because the loop continues to increment i until the condition i <= 4 is no longer true. After the last execution with i equal to 4, the loop increments i to 5 and then checks the condition, which fails, thus exiting the loop and leaving i with a value of 5.

Power Function Comparison

pow(2,3) is not the same as pow(3,2). The pow function returns the value of one number raised to the power of another. Thus, pow(2,3) calculates 2 to the power of 3 (2*2*2), which equals 8, while pow(3,2) calculates 3 to the power of 2 (3*3), which equals 9.

Function Include Files

The functions pow(), sqrt(), and fabs() are all found in the cmath include file of C++.

In the MOV instruction both operands i.e. source andthe destination cannot be

_______________ operands.

Answers

Answer:

an immediate.

Explanation:

It is because of the instruction encoding and decoding.Intel which make these instructions decided not include instructions which provide no real advantage. MOV segment register is one of them because segment register need not to be changed very often.This saves the space in instruction encoding.

Answer: In the MOV instruction both operands i.e., source and the destination cannot be immediate operands.

Explanation:

The destination operand must be in data alterable mode and it cannot be an an immediate operand, or a segment register. Basically, the mov operation are used to copy the values stored in one registers to another registers. It can be used to load a small integer in the register.

. ............... package is used by compiler itself. So it does not need to be imported for use.
A) java.math
B) java.awt
C) java.applet
D) java.lang

Answers

Answer: The compiler automatically imports the java.lang package.

Explanation:

Java packages are defined as a collection of classes, interfaces, and the like. Java programs utilize the components in the packages to implement their functionalities. Packages are either imported by the compiler or by the user through import keyword. The user can import any package using the import keyword. The import statements are always written at the beginning of the program.

import java.math.* ;

For example, the programmer writes the above statement that imports the java.math package into the java program.

Default packages are automatically imported by the compiler.

Default packages include java.lang packages. This default package is made up of all the classes and functions that are mandatory to any java program. Without java.lang package, the java program cannot be compiled and hence, becomes useless. The Java compiler adds the import statement for the default package, java.lang, at the beginning of the compilation. Hence, the statement

import java.lang.*;

does not needs to be written in the program.

The java.lang package consists of useful components which are required for various operations that can be done on the datatypes found in Java language. This package consists of classes and functions which relates to each data type and defines the functions which can be utilized to perform the operations allowed for the respective data types.

The java.lang package consists of Object, String, Math, System, Thread, Exception classes and wrapper classes like Integer, Double etc.. All the operations that can be implemented on the above-mentioned data types utilize the functions defined in their respective classes.

For example, printing on the console is done using System class.

System.out.println();

Also, all the operations done on strings use the methods such as append(), insert(), delete(), and replace(), etc, are pre-defined in the String class in the java.lang package.

Without java.lang package, any Java program cannot be useful.

True of False - use T or F An interface is compiled into a separate bytecode file (.class).

Answers

Answer:

T

Explanation:

An interface is compiled to a separate bytecode class file.

For example of out application has a class myClass.java and an interface myInterface.java:

class myClass{

   String name;

   int age;

}

interface myInterface{

  public String getName();

  public int getAge();

}

Both of these are compiled to their own respective class files by the compiler,namely, myClass.class and myInterface.class.

_________ arguments are passed to parameters automatically if no argument is provided

in the function call.

Answers

Answer:

Default

Explanation:

When a Function is called, you pass a value to the parameter in function Call, and control is transferred to function definition. Parameters are optional that is, a function may contain no parameters.

Function definition contains the block of code to perform a specific task. Default arguments are passed to parameters in function definition if no argument is passed in function call.

Example: C program

#include <stdio.h>    

int s();  //Function declaration

 int main()  

{  

   int n;  

   n = s();  //Function calling with no parameters

   printf("\nSum  = %d", n);  

   return 0;  

}    

int s()  //Function definition

{  

   int c = 50, d = 80, s;  

   s = (c) + (d);  

   return s;  

}

Output:

Sum=130

What is meant when it is said that an exception is thrown?

Answers

Answer:

It is an error in the program that warns the users that something is wrong in the data they have entered

Explanation:

Null pointer exception, ArrayIndexOutOfBounds and arithmetic exception are some of the exception which can be thrown in a code segment. example if we use divide by zero then the exception to be used is arithmetic exception. Similarly we can also define our own conditions for throwing an exception using the keyword throw. Example throw exception class("error message"),

Windows XPProfessional and Windows Vista Both have same devicedrivers.
True
False

Answers

Answer: False

Explanation:

 Windows XP Professional and Windows Vista, both does not have same device drivers because they both have different structural modules. Both windows XP and windows Vista are different in terms of their security architecture, mobile computing and networking technologies.

As, windows XP has suffered from security problems or issues with the performance. Vista has received issue with product activation and performance. Another common problem of Vista is that integration of new form of DRM in the operating system and security technology.

The code calculates and prints the sum of all the elements in the array a.

Int sum = 0;

For ( int I = 0; I < a.length; i++ )

{

//Your code goes here.

}

System .out.println( %u201Csum is %u201C + sum );

Answers

Answer:

public class sum{

    public static void main(String []args){

       int sum = 0;

       

       int[] a = {9,2,8,4,0,6};

       

       for ( int i = 0; i < a.length; i++ )

       

       {

       

           sum = sum + a[i];    

       

       }

       System.out.println("The sum is: "+sum );

   }

}

Explanation:

First create the class in java programming.

Then create the main function and declare the variable and array.

To calculate the sum of all element in array, first we have to traverse the array pick element one by one and then add,

so, we have to use loop for traversing and add with sum which inialize with zero.

suppose array element is 1,2,3,4

sum = sum +a[1]  means sum = 0 +1=1

the sum = 1+2=3, sum = 3+4=7.

and then finally print the result store in sum.

)What are the approaches used to design a Control unit? Brieflycompare them.

Answers

Answer: Control unit is the main unit of CPU which is responsible for handling of the processor's control action. There are two  ways to design a control unit :-

Hardwired control unitMicro-programmed control unit

Explanation: Comparison of the two control units are as follows:-

Hardwired control is comparatively rapid than the micro-programmed control .Hardwired control is circuit type technology and micro-programmed control is software type technology.Hardwired control is based on the RISC architecture and micro-programmed is based on CISC architecture.

Which of the following would be considered a good name for a function that converts temperatures from Fahrenheit to Celsius? A. calc B. convert temp C. temp D. myfunction

Answers

Answer:B) converttemp

Explanation:  A good function name should provide an indication of the task carried out by the function.In this case, our task is related to conversion of temperature from one unit to another. So converttemp would represent a good nomenclature for the function and would enable the end user to determine the applicability of the function to his use case.

True / False
Overflow is usually ignored in most computer systems.

Answers

Answer: True

Explanation: Overflow in computer system is a situation when there is the occurrence of error or disruption due to very large number that is given for calculation cannot be handled.So whenever the range of the particular number given by the user for calculation exceeds is termed as overflow error.It is usually avoided by the computer system because there is not much input given with large numbers for arithmetic operation or can be handled.

In a well-designed detail report, a field called a(n) ____ field controls the output.
Answer
break
indexed
dominant
control

Answers

Answer:

Control

Explanation:

What is the output of the following code segment?

n = 1;
for ( ; n <= 5; )
cout << n << ' ';
n++;




1. 1 2 3 4 5

2. 1 1 1 ... and on forever

3. 2 3 4 5 6

4. 1 2 3 4

5. 2 3 4 5

Answers

Answer

1 2 3 4 5

Explanation:

initialize the value of n with 1

then, for loop is executed until the condition is true.

so, it check the condition 1<=5, condition true, code is executed and print 1

and n become 2.

again check condition 2<=5 condition true, code is executed and print 2

and n become 3.

and so on....

it print 1 2 3 4 5 after that check condition 6<=5 condition false, it terminate from loop.

Therefore, the answer is  1 2 3 4 5

In the second form of ____, the binary operation op is applied to the elements in the range.

A.
adjacent_find

B.
adjacent_difference

C.
adjacent_member

Answers

If I remember correctly from my computer science class it is B.

Consider the following line of code: price= input(Please enter the price: ") What would be the next line in your code that will allow you to store the price as a decimal number price price(decimal) price float(price) price decimal(price) price int(price

Answers

Answer:

price float(price)

Explanation:

There are four basic type of data type use in the programming to declare the

variable.

1. int:  it is used for integer values.

2. float:  it is used for decimal values.

3. char:  it is used for character values

4. Boolean: it is used for true or false.

in the question, the one option contain the data type float (price float(price)). So, it store the value in decimal.

price int(price):  it store the value in integer.

price decimal(price):  it is wrong declaration of variable. their is no data type in the programming which name is decimal.

price price(decimal):  it is wrong declaration of variable. their is no data type in the programming which name is price.

What error occurs in the following program? #include using namespace std; int main() { int number1, number2, sum; cout << "Enter number 1:"; cin >> number1; cout << "Enter number 2:"; cin >> number2; number1 + number2 = sum; cout << "The sum of number 1 and number 2 is " << sum; return 0; }

Answers

Answer:

1. ‘cout’ was not declared in this scope.

2. ‘cin’ was not declared in this scope.

3. lvalue required as left operand of assignment.

Explanation:

The code gives the error cout and cin was not declare. This error means, we not include the library where they define.

cout and cin is the input/output instruction and they include in the library iostream file.

the last error is lvalue required as left operand of assignment.

lvalue means the assignable value, we actually do the wrong assignment.

number1 + number2 = sum;

here, sum is is the assignment variable. so, it must be in the right side of the '=' operator.

sum = number1 + number2 ;

Now, the above is correct. the value number1 plus number2 is assign to sum.

Write a C++ programthat simulates a cash register. The user should keeptyping

in the prices of items andthe register must keep adding them up. When the user

types a 0, the registershould add up the prices of all the items, add 8% salestax,

and output the finaltotal. Example output is given below.


Enter the price of item 1: 5.00

Answers

Answer:

//C++ code for the cash register..

#include <iostream>

#include<vector> //including vector library

using namespace std;

int main() {

vector<float> cash; //declaring a vector of type float.

float item=2,cash_sum=0;

int counter=1;

while(item!=0)//inserting prices in the vector until user enters 0...

{

    cout<<"Enter the price of item "<<counter<<" :"<<endl;

cin>>item;

counter++;

cash.push_back(item);//inserting element in the vector...

}

for(int i=0;i<cash.size();i++)//looping over the vector...

{

    cash_sum+=cash[i];//summing each element..

}

cash_sum*=1.08;//adding 8% sales tax.

cout<<cash_sum;//printing the result....

return 0;

}

Explanation:

I have taken a vector of type float.

Inserting the price of each item in the vector until user enters 0.

Iterating over the vector for performing the sum operation.

Then after that adding 8% sales tax to the sum.

Printing the output at last.

Final answer:

A C++ program simulates a cash register by adding prices entered by the user, ending with a zero input to calculate and output the total with an added 8% sales tax.

Explanation:

The task is to create a C++ program that acts as a cash register, adding up the prices of items entered by the user. When the user enters a zero, the program calculates the total cost including an 8% sales tax and displays it. Below is an example of how this can be implemented:

#include
#include
using namespace std;
int main() {
   double price, total = 0.0;
   int count = 1;
   cout << fixed << setprecision(2);
   while (true) {
       cout << "Enter the price of item " << count << ": ";
       cin >> price;
       if (price == 0) break;
       total += price;
       count++;
   }
   double salesTax = total * 0.08;
   double finalTotal = total + salesTax;
   cout << "Final total after tax: $" << finalTotal << endl;
   return 0;
}

In this program, we use count to keep track of how many items have been entered and total to keep a running sum. The user is prompted for the price of each item, which is added to the total. If the user enters 0, the loop breaks, and the program calculates and outputs the final total, including the sales tax.

Kindly guide me How can I get the easy examples and tutorialsregarding:
a) Finite Automata
b) Transition Graph
c) Generalized Transition Graph
d) Kleen's Theorem

Answers

I thing it’s c but I’m not positive

Given the following Preorder and Inorder traversals, please recover the original tree. Preorder: C F D G H A B E Inorder: G D H F C B E A

Answers

Answer:

To build the original tree follow the steps described below:

In Preorder traversal the root always comes first in the list, so C is the root. In Inorder traversal the nodes those are left to C will be in left sub-tree of C and the nodes those are right to C will be in the right sub-tree of C.Now, in the left sub-tree (G D H F) , F comes first in the Preorder traversal, so F is the root. And as G D H are left to F in Inorder list so, they will be in left sub-tree of F. In the right sub-tree of C, (B E A),  A comes first in the Preorder list. So A is the root and B E will in left subtree of A.In left sub-tree of F, (G D H), D comes first in Preorder list, so D is the root and G is the left child of D and  H is the right child of D.Among (B E), B comes first in Preorder list, so B is the root and as E is right to B in Inorder, so is the right child of B

For more follow the diagram:

Explanation:

Preorder traversal visits the root of the tree first then the left sub-tree and then the right subtree.

Inorder traversal visits the left subtree first then the root and then the right subtree.

_________ variables are defined outside all functions and are accessible to any function

within their scope.

Answers

Answer:

Global Variables

Explanation:

A Global variable is a variable defined usually in the header that can be accessed by any part in a program.

However, this is not a good practice because anything in the program can modify the value of the variable; also, helps to get more difficult to read a code, due to the fact that you need to know where are those variables and where they have been modified.

Example en c++: Check that the final result its 10, it is not necessary to pass the variable as a parameter in functions

#include <iostream>

int varGlobal = 5; // this is the global variable

void ChangeVarGlobal()

{

varglobal=10; // reference to the variable

}

void main()

{

std::cout << global << '\n'; // reference to a variable in a second function

  ChangeVarGlobal();

  std::cout << global << '\n';

  return 0;

}

Digits Sum Write a function main( that reads a positive integer, calls the function digits which finds the digits sum of that integer. The function main( prints the sum. Sample input/output: Enter a positive integer: 20010 The digits sum of 20019 is 3

Answers

Answer:

#include<iostream>

using namespace std;

int digits(int number){

   int sum=0;

   while(number != 0){

       int rem = number % 10;

       sum = sum + rem;

       number = number/10;

   }

   return sum;

}

int main(){

   int number;

   cout<<"Enter the integer: ";

   cin>>number;

   int result = digits(number);

   cout<<"The sum of digits is: "<<result<<endl;

}

Explanation:

Include the library iostream for use of input/output.

Then, create the function digits with return type int.

Take a while loop and put a condition number not equal to zero.

the while loop executes the until the condition is not false.

In the while loop, take the remainder of the number and store in the rem variable.

after that, the store in the sum then reduces the number by dividing 10.

for example:

the number is 123.

rem = 123%10 it gives the value 3.

sum = 0+3=3

number = 123/10 it equal to 12

then,

rem = 12%10 it gives the value 2.

sum = 3+2=5

number = 12/10 is equal to 1

the same process executes until the number becomes zero and then the while loop terminates and the sum value returns to the main function.

create the main function and take the value from the user and call the function with the argument number.

and finally, print the result.

. Stress can affect not only your health, but also other aspectsof your
life. What else can be affected by stress?
a. Family relationships
b. Work performance
c. Your attention to safety
d. All of the given options

Answers

Answer:

d

Explanation:

all of this. all of this can happen due to stress

Write a C++ code that will read a line of text convert it to all lower case and print it in the reverse order. Assume the maximum length of the text is 80 characters. Example input/output is shown below:

Input:

Hello sir

Output:

ris olleh

Answers

C++ program for converting it into lower case and printing in reverse order

#include <iostream>

#include <string>

#include <cctype>

using namespace std;

//driver function

int main()

{

// Declaring two string Variables

//strin to store Input string

//low_string to store the string in Lower Case

string strin, low_string;

int i=0;

cout<<"Input string: "<<endl;

/*getline()method is used to store the characters from Input stream to strin string */

getline(cin,strin);

//size()method returns the length of the string.

int length=strin.size();

//tolower() method changes the case of a single character at a time.

// loop is used to convert the entire Input string to lowercase.

while (strin[i])

{

  char c=strin[i];

  low_string[i]=tolower(c);

   i++;

}

//Checking the length of characters is less than 80

if(length<80)

 {

    cout<<"Output string: "<<endl;

   //Printing the Input string in reverse order, character by character.

    for(int i=length-1;i>=0;i--)

   {

    cout<<low_string[i];

   }

cout<<endl;

}

else

    {

       cout<<"string Length Exceeds 80(Max character Limit)"<<endl;

    }

return 0;

}

Output-

Input string:

Hello sir

Output string:

ris olleh

Java provides a(n) ____ class, which contains many useful methods for manipulating arrays.

a.
Table

b.
Sort

c.
Arrays

d.
Object

Answers

Java presents Array Class, which contains many useful methods for manipulating "arrays".

It is essential because it introduces arrays and with that concept of "container variables".

Arrays are used everywhere.

Hope this helps.

r3t40

electronic business includes which of the following

A. servicing customers

B. buying and selling

C. conducting electronic transactions within an organization

D all of these

Answers

Answer:

D. all of these

Explanation:

Electronic business includes :  servicing customers, buying and selling , conducting electronic transactions within an organization.

Answer is all of these- D.

How would you copy all files from a remote directory into your LOCAL home folder.

Answers

Answer: Using secure copy 'SCP' we can copy all files from a remote directory into local folder. It also replaces existing files.

Explanation:

This is illustrated as follows:

scp -r username@IP:/path/to/server/source/folder/  .

-r is recursively copy all files

username is your username in your system

IP, here you cab specify the IP or type the website such as www.google.com

Then we specify the path, complete path

"." dot here refers the current directory. To copy the contents in the current directory.

The Flow of Control refers to the order in which statements are executed. TRUE FALSE

Answers

Answer:

TRUE

Explanation:

The Flow of Control refers to the order in which the statements are executed.

One can understand the code if he knows the flow of control.

Other Questions
Which patient statement supports a diagnosis of narcolepsy? A. "My wife tells me i snore at night" B. "I sleepwalk several nights a week" C. "I have no control over when i fall asleep" D. "My legs feel funny, and that keeps me awake" Suppose that a box contains r red balls and w white balls. Suppose also that balls are drawn from the box one at a time, at random, without replacement. (a)What is the probability that all r red balls will be obtained before any white balls are obtained? (b) What is the probability that all r red balls will be obtained before two white balls are obtained? If y= x^2+3x+5, evaluate y given x= 2+i . Look at the image, read, and choose the option with the correct preposition and article that match the image.People playing volleyballCuando hace calor prefiero jugar ________ voleibol. a el al el a la The chair of the board of the local Humane Society chose the bank where the organization keeps its money; however, the office manager is the primary person who makes deposits, writes checks, and balances the account every month. The office manager is the ________ in the buying center for the bank account. The slope of the line passing through the points (-1, 5) and (3,5) is the degree of the polynomial 3x^3+0x^4+8 (A) 4(B) 1(C) 3(D) 2 find the gcd and lcm of 20 and 56 The lengths of two sides of a right triangle are 12 inches and 15 inches. What is the difference between the two possible lengths of the third side of the triangle? Round your answer to the nearest tenth. 10.2 inches 24.0 inches 28.2 inches 30.0 inches Drag each label to the correct location on the image.Identify the different elements in the excerpt from Trifles by Susan Glaspell. Professor N. Timmy Date has 31 students in his Calculus class and 17 students in his Discrete Mathematics class.(a) Assuming that there are no students who take both classes, how many students does Professor Date have?(b) Assuming that there are five students who take both classes, how many students does Professor Date have? g The size of the atom in Rutherfords model is about 8 1011 m. Determine the attractive electrostatics force between a electron and a proton separated by this distance. Answer in units of N. An urn contains 11 numbered balls, of which 6 are red and 5 are white. A sample of 4 balls is to be selected. How many samples contain at least 3 red balls? What is shock incarceration SUPER EASY WILL GIVE BRAINLEIST IF DONE BEFORE 10 P.M. PLS HURRY. IF U HAVE TIME PLS HELP ME ON OTHER QUESTIONS THANK YOU Identify the discontinuity and zero of the function f(x)= 4x/x^2-16 A person receives an O allele and an A allele for blood type. What is the individuals blood type? type A type B type AB type O Starting with the atom and ending with the biosphere, record the Levels of Organization found in life. A slider of mass 0.25 kg on a string, 0.5 m long is rotating around a pivot on a frictionless table. The velocity of the slider is initially 0.05 m/s. When the string is pulled into a radius of 0.125 m how fast is the mass spinning? Determine the number of x-intercepts that appear on a graph of each function. f(x)= (x-6)^2(x+2)^2