Which statement correctly tests int variable var to be less than 0 or more than 50?

Answers

Answer 1

Answer:

if-else statement.

Explanation:

if-else is the conditional statement that can be used for checking the condition.

Syntax of if-else statement:

if(condition){

statement;

}else{

statement;

}

if the condition put in the if part is TRUE, then the statement inside the if will execute. if the condition put in the if part is FALSE, then the else part will execute.

In the question for testing the variable var is less than or more than 50, if-else statement is best statement.

We can used like that:

if(var<0 || var>50){

printf("Test pass");

}else{

printf("Test failed");

}


Related Questions

In a database, data is stored in spreadsheets which have rows and columns.

A.

True

B.

False

Answers

The answer is A. True.
Final answer:

A spreadsheet is a collection of data organized into rows and columns. However, it has limitations compared to relational databases in terms of data organization and accessibility.

Explanation:

A spreadsheet is a collection of data that is organized into rows and columns. Each column represents a field or attribute, while each row represents a record or data instance. While spreadsheets can function as a type of database, they have limitations in terms of data organization and accessibility compared to relational databases which use a tabular structure and allow for easier reorganization and access of data.

True / False
Some versions of the Von Neumann model include the stored program concept, but not all of them.

Answers

Answer: True

Explanation:

The Von Neumann model is based on the concept of stored program where both of the program and instruction data are stored in the same electronic memory. Though it is still used in many models but due to the Von Neumann bottleneck we have the introduction of the secondary memory.

Programs that are embedded in a Web page are called Java ____.

a.
consoles

b.
windowed applications

c.
applications

d.
applets

1 points

Answers

Answer:

applets

Explanation:

Java applets are dynamic programs that can be embedded on a webpage and run on a web browser like internet explorer,firefox or google chrome. The code for applets is developed using java programming language and facilitates interesting and complex display entities to be included as part of the web page. HTML provides a special tag called <Applet> for providing details of the applet.

Write difference in the form of a table between Ping and TraceRoute command?

Answers

Explanation:

Ping

A network utility which is mainly used to test the connection between two devices or nodes. Ping is used to test the connectivity of a network and its name resolution.Syntax: ping <ip address>

TraceRoute

A network utility which is mainly used to track the path followed by a packet within a network from the source to the destination.It helps to trace the exact pathway of the data packet from the source to the destination.Syntax: tracert <ip address>

 

 

Give brief comparison of Broadcast, Unicastand Multicast?

Answers

Answer:

In broadcast the message is transmitted from one to all , in uni cast we have one to one transmission and in multicast we have transmission from one to many.

Explanation:

If we take the example of a simple messaging application it will be clear. If a message is exchanged between one person to another, then it is uni casting. If a person sends a message to all the persons in his contact list then it is broadcasting and  if a person sends messages to select persons in his contact list then it is multi casting. In multi casting management of the group is required regarding who can receive messages which is not required in broadcasting.

What is the height of the tallest possible red-black tree containing 31 values?

Answers

Answer:

The height of tallest possible red-black tree having 31 values is 10.

Explanation:

The height of tallest possible red-black tree = 2㏒₂(n+1)

here we have n=31 So substituting the value of n in the equation.

=2㏒₂(31+1)

=2㏒₂(32)

=2㏒₂(2⁵)                   since ㏒(aⁿ)=n㏒(a)  

=2x5㏒₂(2)

=10㏒₂(2)                   since ㏒ₙ(n)=1.

=10.

. Frequency band in which 99% of the total power resides iscalled _________

a. Power bandwidth

b. half power bandwidth

c. 3dB bandwidth

d. 4dB bandwidth

Answers

Answer:

Frequency band in which 99% of the total power resides iscalled Power bandwidth-a.

What is the advantages and disadvantagesof International Standards for NetworkProtocols.

Answers

Answer:

Advantages and disadvantages of international standards for network protocols are:

Advantages -

Due to common underlying standard maintenance and installation become easy. Many computers can connect together from all the worldwide, as they are using the international standard for network protocol. One of the main advantage using international standard as it boost up growth and economy.

Disadvantages -

Every network standard has its own limitations in a particular domain. Once it is spread worldwide then it is difficult to resolve network issues.

What are the advantages and disadvantage of integers and floating numbers?

Answers

Answer:

Explanation:

Advantages of int and disadvantages of float are as following :-

1.Arithmetic operation on int variables are much faster than float variables.

2.int variables does not suffer from precision loss while float variable sometimes suffer from it.

Advantages of float variables and disadvantages of int variables are as following:

1.float variables can represent values between integers.While integers cannot do that.

2.Float can represent much greater range of values than integers.

What is the role of a Chief Information Officier in anorganization?

Answers

Answer and Explanation:

There are several roles of a Chief Information Officer in any organization and these are as follows:

He must fulfill his responsibility as a business leader.He must be able to make executive decisions regarding sales and purchase related matters. He must be able to deal with all the Information Technology related problems.He must be able to recruit the best candidates in the best interest of the organization.He is required to map out the ICT policy(includes procurement, external and internal standards of an organization, future proofing) and ICT strategy.He must be able to write up ICT policy  with detail of its utilization and application.He must possess organizational skills

One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input, and outputs the number of laps. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("%.2f", yourValue); Ex: If the input is:

Answers

Answer:

import java.util.Scanner;

public class Miles {

public static void main(String[] args) {

   //initialization

       double Number_Miles;

       //print the message

       System.out.print("Enter the number of miles: ");

       Scanner scn1 = new Scanner(System.in);

       

       Number_Miles = scn1.nextDouble();  //read the input from user

       //calculate the laps

       double yourValue = Number_Miles/0.25;

       //display the output on the screen

       System.out.printf("%.2f", yourValue);

     

}

}  

Explanation:

First import the library Scanner than create the class and define the main function. In the main function, declare the variables.

print the message on the screen and then store the value enter by the user into the variable.

Scanner is a class that is used for reading the output. So, we make the object of the class Scanner and then object call the function nextDouble() which reads the input and store in the variable.

After that, calculate the number of laps by dividing the number of miles with the given one lap running track value (0.25 miles).

[tex]Number\,of\,laps = \frac{Number\,of\,miles}{0.25}[/tex]

the output is stored in the variable.

After that, print the value on the screen with 2 digits after the decimal point.

we can use "%.2f" in the printing function in java.

like System.out.printf("%.2f", output);

Answer:

def miles_to_laps(miles):

  return miles / 0.25

miles = 5.2

num_of_lap = miles_to_laps(miles)

print("Number of laps for %0.2f miles is %0.2f lap(s)" % (miles, num_of_lap))

Explanation:

: Differentiate between serial and parallel data transfer withat least one example of each from computer sciencedomain.

Answers

Answer:

In serial communication transfers one bit of data at a time, while parallel communication transfers many bits of data at the same time. Serial communication transmits the data bits sequentially, while parallel communication transmits data bits simultaneously, allowing greater amounts of data to be transferred.

-Serial communication is the one used to communicate the Arduino with the Computer through the USB cable.

-An example of a parallel port is the printer port. The Parallel Port was only created and used in the printers interface and the computers.

Explanation:

In serial communication, each bit is sent by its own clock flank where conditions are defined after each byte, if it is synchronous or asynchronous. In parallel communication there is only one single clock flank where the information is sent where it is an advantage to use it where there are several input or output data.

I hope it's help you.

Decision trees are best suitedfor:
one decision inone period.
one decision overseveral periods.
several decisionsover one period.
several decisionsover several periods.
None ofthese.

Answers

Answer: Decision Trees are best suited for several decisions over one period.

Explanation:

Decision tree gives an effective method for making decisions. It is a tree-like model used for decisions and analyses consequences, including resources cost, outcome and utility. It also helps us to make best and good quality decisions on the basis of given information. It is also widely used in machine learning and commonly used  in data mining as a tool.

Write a program that prompts the user to enter the number of students and each student's name and score, and finally displays the student with the highest score and the student with the second highest score.

Answers

Answer:

  see attachment

Explanation:

You have not specified the language, or the details of the I/O form or prompts. Here is a program that does that, written in Wolfram language (the language of Mathematica).

It prompts separately for student name and student score. The minimum score is presumed to be higher than -99999. If only one student name is entered, the second output is that score with no name listed. There is no error checking.

We have elected to keep a list only of the two two scores, and to sort that list again each time a new entry is made.

__

The attachment shows the output of the program below the program listing.

In ________ for final fields and methods the value is assignedlater but in ______ you assign the value during declaration.
Java , C++
C++ , C#
Java , C#
C++ ,Java

Answers

Answer:

The answer to this question is Java,C++.

Explanation:

We can assign non static final variables a value with the declaration or in the constructor but this is not the case with c++ because we have to assign value during declaration and c++ equivalent of final is const keyword and there is sealed or readonly keywords in c# not final.If we do not assign value at the time of declaration the const variable will contain garbage value which cannot be changed afterwards.

Answer:

The answer to this question is Java,C++.

Explanation:

We can assign non static final variables a value with the declaration or in the constructor but this is not the case with c++ because we have to assign value during declaration and c++ equivalent of final is const keyword and there is sealed or readonly keywords in c# not final.If we do not assign value at the time of declaration the const variable will contain garbage value which cannot be changed afterwards.

What are .Classification for computer softwares?

Answers

Answer: Classification of computer software are:-

System softwareApplication software

Explanation:

System software-it is the type of software that takes input from other  device ans sources and then covert it into machine language that is understood by the operating software.E.g.-UNIX Application software- it is the software that is connected with the end user through application present on the operating system which is accessed directly by the user. E.g.-Internet Explorer

What is one property of a good hash code?

Answers

Answer:- Major property of a good hash code is that objects which are equal should return the same hash code .

Explanation: Hash codes is a numeric value which  is used for identify a object while a equality testing .Hash code can occupy the value of any length and then returns a fixed length value. The value of hash codes are variable.

If two objects are equal then by the method of equal(object) if the hashcode() function is called on both the objects , they produce the same value.

True / False
The exponent in floating point is stored as a biased value.

Answers

Answer:

True

Explanation:

The bias value present in a floating point number deals with the positiveness and negativeness of the exponent part for a floating point number.  The bias value for a floating point number is 127. It means that 127 is always needed to be added to the exponent part of any floating point number.

In a single precision floating point number, we need 8 bits to store the exponent. Rather than storing it as a signed two's complement number, it is easier to simply add 127 to the exponent (because the lowest value that can be in 8 bit signed is -127) and simply store it as an unsigned number. If the stored value is bigger than the bias then it would mean the value of the exponent is positive otherwise it is negative, but if they are equal then it is 0.

Explain the purpose (using only two sentence in each case) of eachof the following
components of UML

• Use case diagram
• Use case description
• Class diagram
• Sequence diagram
• Business or Domain model

Answers

Answer:

UML - Unified Model Language

Explanation:

Use case diagram:

A use case diagram is used to tell how many ways a   user can interact with  a system. We use special   symbols and connectors to build use case   diagrams.  

We use  horizontal shaped ovals to represent use   cases, stick figures to represent actors, lines to   represent associations between use cases and  

actors, packages to put elements into  groups.  

Use case description:  

By the name itself, we can say that it is used to   describe the activities of user that  he can do with   the system and how the system responds to those.  Before use case diagram created, we need to write   a use case description.  

Class diagram:  

UML diagrams are of two types. They are,  

Structural UML diagrams Behavioral UML diagrams

A class diagram comes under Structural UML   diagrams.

Classes are building blocks of an application that   uses OOPs concepts. Class diagrams are used to   represent classes, relationships, association,  

interface.  

Sequence diagram:  

A sequence diagram comes under  Behavioral UML   diagrams.It is used to tell the sequential order of   objects' interaction.We have many notations in this   diagram like actors, lifeline, create message, delete   message, lost message, found message etc. It is   used to tell how messages move between objects in   a system.  

Domain model :  

A domain model is a visual representation of real-  situation objects. In UML,  the Domain Model is   illustrated with a set of class diagrams

define the role of cache memory in computers.

Answers

Answer:

Cache memory is relatively small in size as compared to the main memory. The cache memory stores programs, variables which are frequently used by the processor.

Explanation:

The cache memory is placed very close to the processor so that the programs and variables can be accessed very quickly as and when required by the processor. The size of the cache memory is small and also cost more. There is also a secondary cache in many systems which enables to store more programs which cannot be store in the primary cache.

.The operation signature has all the following except:
A.name of the operation B.object accepts C.algorithm ituses D.value returned by the operation

Answers

Answer: C) algorithm it uses

Explanation: The operation signature has the name of operation ,objects that it accepts and the value returned by the operation but it does not have algorithm that it uses.As algorithm defines all the steps that are to be used to find the result so signature operation does not include the whole algorithm that is to be used. The signature operation verifies the steps of the algorithm in way.

What are fields? Instance variables? object? methods?

Answers

Answer:

Explained

Explanation:

Fields: Fields represent data and should be a noun. It should begin with a lower case letter.

Instance variable: it is a variable defined in class but outside the constructor and the method. instance variables are created when an object is instantiated.

Object: An object is the basic unit of object oriented programming language.and represents the real life entities. An object consists of state behavior and properties.

Method: Method in a collection of statements that perform some specific task and return the result to the caller.

A ____________________ can be used to hierarchically represent a classification for a given set of objects or documents. A. taxonomy B. framework C. scheme D. standard

Answers

Answer:

A. taxonomy

Explanation:

A taxonomy can be used to hierarchically represent a classification for a given set of objects or documents.

A database is called "self-describing" because it contains a description of itself.

A.

True

B.

False

Answers

Answer:

true

Explanation:

An objective function in linearprogramming is a(n):

decisionvariable.
environmentvariable.
resultvariable.
independentvariable.
constant.

Answers

Answer: An objective function in linear programming is a decision variable.

Explanation: An objective function is a function which has the target towards the model whether it should be maximized or minimized according to the relation between the  variables present in the function. There are set of variables which are responsible for the controlling of objective function that is known as decision variables.

When you declare a method as abstract method ? Can I call a abstract method from a non abstract method ?

Answers

Answer: A method without body is called abstract method. A abstract method can be called from a non abstract  class or method provided it is inherited using a subclass.

Explanation:

An abstract method is a method which does not have a body, it just has opening and closing curly braces. A class having an abstract method is also declared as abstract class. We cannot make an object of the abstract class.

example : public abstract float multiply(float x, float y);

is an example of abstract method.

calling an abstract method from a non  abstract method is possible provided it is inherited by a non abstract subclass.

what is Interrupt?and give me information about Interruptstypes and processes and works?

Answers

Answer:

Interrupt is defined as, in computer system interrupts are the signal sent to the central processing unit by the external devices. The main function of interrupt is that, an operating system that provide multiprocessing and multitasking. The interrupt is a signal that causes the operating system to stop work on one processor and started work on another processor.

There are basically two type of interrupts:

Hardware interrupts - For the processor, if the signal is from external device and hardware is called hardware interrupts.Software interrupts - The interrupt which is caused by the software instructions are called software interrupt.

FS and GS are two___________________ in protected mode.
? segment registers
? segment selectors
? stack pointers
? register pointers

Answers

Answer:

Segment registers

Explanation:

The initial purpose behind the segment registers was to enable a program to access many distinct (big) memory sections designed to be autonomous and part of a constant virtual store.

They don't have a processor-defined objective, but instead Operating system runs them for purpose. The GS register is used in Windows 64-bit to point to constructions defined by the operating scheme.   Operating system kernels usually use FS and GS to access thread-specific memory. In windows, thread-specific memory is managed using the GS register. To access cpu-specific memory, the linux kernel utilizes GS.

Non proprietary standard is also termed as____________

a. De facto standard

b. Le facto standard

c. Pre facto standard

d. Non facto standard

Answers

Answer: Option A) De facto standard

Non proprietary standard is also termed as de facto standard.

Explanation:  Non proprietary standard is also termed as de facto as when the proprietary standard such as window are widely used, then it becomes  de facto standard. When de facto standard is referring in terms of computers, it is an accepted application, design or language standard that is used in industry but not officially recognized.  

An example of de facto standard is paper clip ion used in e-mail to represent an attachment.  

Write a conditional expression that assign the value 0 to a credits variable if it is less than 0; otherwise the value of the credits variable remains unchanged.

Answers

Answer:

credits = (credits < 0) ? 0 : credits;

Explanation:

This is the ternary conditional operator.

Answer:

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

Explanation:

I am going to write a C function for this.

The input is your credit value, and it has just a conditional to verify if it is not negative.

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

Other Questions
A person who inherits a lot of money won't need financial literacy skills because he is already rich. A. True B. False2b2t What amount of heat is required to raise the temperature of 20 grams of water from 10C to 30C? The specific heat of water is 4.18 J/gC. what dose 24/15 equals to? Find the moment of inertia of a hoop (a thin-walled, hollow ring) with mass M = 1kg and radius R = 1m about an axis perpendicular to the hoops plane at an edge. (Express your answer in units of kg*m^2). Centurion Alarms recently declared a 10 percent stock dividend. Prior to the stock dividend, the equity section on Centurion's balance sheet was: Common stock (100,000 shares outstanding, $1 par value) $100,000 Additional paid-in capital 60,000 Retained earnings 90,000 Total common shareholders' equity $250,000 Centurion's stock currently sells for $4 per share. After the stock dividend is paid, the amount in the Common stock account should be _______ and the amount in the Retained earnings account should be ______. $110,000; $50,000 $100,000; $90,000 $140,000; $50,000 $100,000; $50,000 $90,000; $110,000 Molecules like DNA may be stretched and are well modeled as springs. An optical trap can pull with a maximum force of 11\; fN11fN (femto-Newtons) and can stretch a DNA molecule by 0.06\; \mu m0.06m . What is the spring constant of the molecule? A quadrilateral PQRS is inscribed in a circle, A quadrilateral PQRS is inscribed in a circle. The measure of angle PQR is 85 degrees. What is the measure of arc PQR? Evaluate the function at the indicated values if possible. If an indicated value is not in the domain, say so.f left parenthesis x right parenthesis equals StartFraction x plus 7 Over x squared minus 9 EndFraction; f left parenthesis negative 7 right parenthesis, f left parenthesis 2 right parenthesis, f left parenthesis 3 right parenthesis What are the zeros of f(x) = x2 + x - 20? In the figure below, triangle ABC is similar to triangle PQR, as shown below:what is the length of side PQ?A) 18B) 4C) 32D) 6 If the distance between point R(a,a,a) and point J(6,-2,0) is 10, then the value of a could be? You can prioritize other life goals by being abstinent.A. TrueB. False Question 7 of 10 A "moon" is a relatively large object that orbits a planet. Which of the following planets does not have a moon ? A. mercury B. mars C. Saturn Reset Selection An industrial machine requires a solid, round piston connecting rod 200 mm long, between pin ends that is subjected to a maximum compression force of 80,000 N. Using a factor of safety of 2.5, what diameter is required if aluminum is used with properties Sy = 496 MPa and E = 71 GPa? for a small to medium enterprise , the benefits of setting up an e-commerce store front include ( choose all that apply)A. The ability to offer a larger selection of productsB. the ability to reach a wider customer base C. the ability to eliminate advertisingD. the ability to offer lower prices to customers Which of the following best describes a parabola?OA. The set of all points in a plane that are equidistant from a singlepoint and a single lineOB. The set of all points in a plane that are equidistant from two pointsOC. The set of all points in a plane at a given distance from a givenpointOD. The set of all points in a plane that are equidistant from two pointsand a single line Price of a jeep dropped from 27000 to 22900. What was the percent decrease in price nearest hundredth percent? In an eight-hour day Nicolas can catch 24 pounds of fish or he can repair 15 cars. In an eight-hour day Alejandro can catch 27 pounds of fish or he can repair 18 cars. If both men decide to follow their comparative advantage then Nicolas will gain from trade if he can sell 100 units of the good he is specializing in for at least ____ units of the other good. Enter a number rounded to 2 decimal places as necessary. In medieval Europe an important technological advance was the use of the padded horse collar for plowing. Once this idea was thought of, other people used it. This illustrates that knowledge is generally a ___ (A) societal good(B) private good(C) normal good (D) public good Please help I need it so bad