Answer: mathematical modelling helps to look into the uncertainties in the calculations based on the observational data.
Explanation:
In bioinformatics for example in gene data expression there can millions of data obtained through various observatory experiments. however most of the data is inadequate to arrive at at a conclusion. So in order to solve this issue we have to apply mathematical modelling to consider those data which would help us to understand the models behavior and access its performance.
Final answer:
Mathematical Modeling is critical in bioinformatics, enabling the analysis of large datasets and the development of new frameworks necessary for understanding complex biological systems. It aids in sequence comparison, hypothesis testing, and simulation of biological systems, often in conjunction with experimental validation.
Explanation:
The importance of Mathematical Modeling in the field of bioinformatics cannot be overstated. Bioinformatics, a field that marries biology with computer science, relies heavily on Mathematical Modeling to sift through and make sense of the vast datasets generated by modern biological research, such as genome sequencing and gene expression profiling. Computational power and Mathematical Modeling enable biologists to perform sequence comparisons, test hypotheses, and create in silico research that might predict biological phenomena. It is especially necessary for managing the complexities brought about by Next-Generation Sequencing technologies, requiring the development of new statistical and theoretical frameworks.
Mathematical models in bioinformatics are crucial for describing scientific phenomena and evaluating costs, requiring the application of various mathematical skills and concepts like algebra, calculus, and statistics. They support the engineering design process within bioinformatics by enabling the construction of comprehensive simulation models. These models are instrumental in understanding the structure and behavior of biological systems, sometimes even without direct experiments. However, it is critical to validate these models with observations to ensure their accuracy and efficacy.
In summary, Mathematical Modeling serves as a fundamental tool for bioinformatics specialists, assisting them in processing and interpreting large datasets to advance our understanding of biological systems and processes. It is a bridge between theoretical biology and practical computer-based analysis that is essential for data-driven discoveries in bioinformatics.
What is one of the problems with project managementsoftware?
The project manager manages the software instead of theproject
Project duration calculations are sometimesapproximate
You cannot override the project management softwaredecisions regarding schedule
It’s expensive and difficult touse
Answer: It’s expensive and difficult to use
Explanation:
The problems with project management software is that it is expensive and difficult to use as, the scale of project grow and their impact reach beyond the functional unit. Budget is one of the main issue in planning and tracking. It is time intensive to learn and refresh the interface design and also there is no invoicing or billing included.
Write a program which will ask the user to input a floating point number corresponding to temperature. We will assume the temperature was in Celsius degrees and display its equivalent in Fahrenheit degrees after computing it using the following formula Fahrenheit = ( 9.0 / 5.0 ) * Celsius + 32
// writing c++ code...
// taking input
cout<< " Enter the floating point number : ";
cin>>fnumber;
// calculating the Fahrenheit temp
far_temp= (9.0/5.0) * fnumber +32;
cout<<" Fahrenheit = "<< far_temp;
Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7. Hint: Start with "numUsers = ...".
import java.util.Scanner;
public class UpdateNumberOfUsers {
public static void main (String [] args) {
int numUsers = 0;
int updateDirection = 0;
numUsers = 8;
updateDirection = 1;
/* Your solution goes here */
System.out.println("New value is: " + numUsers);
return;
}
}
Answer:
import java.util.Scanner;
public class UpdateNumberOfUsers {
public static void main (String [] args) {
int numUsers = 0;
int updateDirection = 0;
numUsers = 8;
updateDirection = 1;
if(updateDirection==1){
numUsers++;
}else{
numUsers--;
}
System.out.println("New value is: " + numUsers);
return;
}
}
Explanation:
Conditional statement is the statement which used to check the condition, if condition is TRUE then execute the statement otherwise not execute.
if else is the Conditional statement which used in the programming.
According to question, if updateDirection == 1, then increment numUsers , otherwise decrement.
these are the condition which can put in the if else statement:
if(updateDirection == 1)
{
numUsers++; //increment
}else{
numUsers--; //decrement
}
__________ was awarded the Nobel Prize in physics forhis work on the photoelectric effect.
That Einstein
It was Einstein
Einstein who
Einstein
Answer:
Albert Einstein
Explanation:
Hello, great question. It is always good to ask questions and get rid of any doubts.
Albert Einstein was awarded the Nobel Peace Prize for his work on Photoelectric Effect in the year 1921. Albert Einstein was a physicist who was born in Germany in 1955, and dedicated his life to science. Largely known for his discovery of the General Theory of Relativity. Einstein won the Nobel Peace prize for discovering that light are formed in packets of energy that travel at in different frequencies or wave lengths.
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.
Final answer:
"Albert Einstein" was honored with the Nobel Prize in Physics in 1921 for his explanation of the photoelectric effect, which supported the quantized nature of electromagnetic radiation and introduced the concept of photons.
Explanation:
Albert Einstein was awarded the Nobel Prize in Physics for his groundbreaking work on the photoelectric effect. His innovative approach posited that electromagnetic (EM) radiation could be quantized, which revealed that the energy transported by EM waves is composed of individual units known as photons. Specifically, Einstein introduced the concept that a photon's energy is proportional to its frequency, given by the equation E = hf, laying the foundational principles for quantum mechanics and revolutionizing the understanding of light's particle-wave duality.
Einstein's insights into the photoelectric effect were instrumental and surpassed his more publicly celebrated theories of relativity. In 1921, Einstein received the Nobel Prize, not for his theories of relativity as they were still under scrutiny, but for his explanation of the photoelectric effect, which had vast implications for the development of quantum physics. Einstein's achievement is a stark example of how his work extends well beyond the widely known realm of relativity.
The value of a default argument must be a(n) _________.
Answer:
Constant
Explanation:
A default argument is a value provided in a function declaration that the compiler automatically assigns if the function caller does not provide a default value for the argument.
The value of a default argument must be constant.
The default value parameter must be a constant for compiling. Compiler does not accept dynamically calculated value against optional parameter. The reason behind this it is not certain that the dynamic value you provide would offer some valid value.
Example:
#include<iostream>
using namespace std;
/*A function with default arguments, it can be called upto 4 arguments*/
int sumnum(int x, int y, int z=0, int w=0)
{
return (x + y + z + w);
}
int main() //driver function
{
cout << sumnum(10, 15) << endl;
cout << sumnum(10, 15, 25) << endl;
cout << sumnum(10, 15, 25, 30) << endl;
return 0;
}
Output
25
50
80
Nyquist states that the bit rate of a noise-free digital transmission can be no more than one-half the bandwidth of the signal.
a) True b) False
Answer: False
Explanation:
Nyquist states that the bit rate of a noise-free digital transmission is shown by
C = 2 B log2 m bits/sec
where,
C is the channel capacity
B is the bandwidth of the channel
and m is the number of discrete levels in the signal
When superiors providedirections to their subordinates regarding what to do, thisis
known as a type of____________________ communication.
o Upward
o Horizontal
o Downward
o Lateral
Answer:
Downward
Explanation:
Downward communication
When instructions/orders given from Superiors to Subordinates.The instruction can be via mail,oral or handbooks it can be of any form. Examples are shareholders instructing management,teacher ordering students to bring notebooks etc.
Upward communication
When Information is sent bottom level to the upper levels in an organization.The information includes reports,judgments, estimations, propositions, complaints, appeals, etc
Lateral communication/Horizontal communication
When same hierarchical levels shares idea or information with each other for coordinating, fulfilling a common purpose or goal.It doesn't involve sharing information with up or down levels in organization.
The tremendous diversity ofthe source system is the primary reason for their complexity. Doyou agree/ If so, explain briefly why.
Answer and Explanation:
Yes, the situation mentioned in the question is agreeable.
Diversity in the field source system is due to the presence of data elements present in the system which directly increases the complexity of the system.The data can be stored in one place in any amount at present time due to developed technology but there are chances of lapse and complexity.
The reason is the variety of types of data that is stored which makes it difficult to access the data related to every single element especially when the data storage is in a large amount. Individual data sources also don't show high dependency on. Thus the complexity arises.
True / False
Variable length instructions generally use memory more efficiently than fixed-length instruction sets.
Answer: True
Explanation:
Variable length instructions generally implemented by CISC processors use memory more efficiently than fixed length instruction of RISC processors sets because CISC supports array whereas RISC does not. Also CISC uses more complex addressing modes which consumes less memory cycles and the the program is also reduces. In Fixed length instruction in RISC processor the simple instructions has to be used a number of time which leads to more memory cycles.
Perfective maintenance usually is cost effective ____ the system
Answer:
During the middle of
Explanation:
Perfective maintenance usually is cost effective during the middle of the system.
Perfective maintenance usually is cost effective during the middle of the system.
Write a pseudocode statement thatassigns the sum of 10 and 14 to the variable total.
Answer:
Declare x,y and total as variables
Set x=10
Set y=14
Set total = x+y
Output Total
Explanation:
In this pseudo code we are declaring 3 variables x to hold the value 10 y for holding the the value 14 and total for holding the sum of x and y. We have assign 10 to x 14 to y and then we are assigning the sum of x and y to the total variable.then we are printing the total. Above written is the pseudo code for the same.
Final answer:
To assign the sum of 10 and 14 to a variable named 'total' in pseudocode, you would simply write: 'total = 10 + 14'. This sets the variable 'total' as an accumulator, storing the calculated sum.
Explanation:
The pseudocode to assign the sum of 10 and 14 to the variable total can be written as follows:
total = 10 + 14
This statement creates an accumulator variable named total that holds the combined value of 10 and 14, which is 24. In programming, an accumulator is a common term used to describe a variable that accumulates the sum of multiple numbers, either through direct assignment as shown, or within a loop structure that iteratively adds to the total.
As an example, if we were to use a loop to calculate the sum:
total = 0
for i = 1 to 2
if i == 1
total = total + 10
else if i == 2
total = total + 14
end for
The decision-maker's attitude toward riskcan change the outcome of a situation involving risk.
True
False
Answer: True
Explanation: Yes, there is a major impact of the decision maker's attitude on a risky situation. In risky situation if the decision maker is on side of taking non-risking decision then there would be less chances of severe outcome but if the decision maker tends to take risk then the situation can have any sort of impact good or bad as outcome. Therefore there is a huge impact of decision makers attitude.
If the unitexchanged at the data link level is called a Frame and the unitexchanged at the Network layer level
is called a Packet, doframes encapsulate packet or do packets encapsulate frames? Explainyour answer.
Final answer:
Frames encapsulate packets in the context of networking, where the data link layer adds headers and trailers to the packet, forming a frame that is transmitted over the physical medium.
Explanation:
In the context of networking, frames encapsulate packets. When a packet, which is the unit of data at the network layer, is passed down to the data link layer to be prepared for physical transfer, it is encapsulated within a frame. The data link layer adds a header and sometimes a trailer to the packet, creating a frame. This frame includes not only the original packet's data but also additional information such as source and destination addresses, error-checking codes (like CRC), and control information necessary for establishing reliable links and ensuring data integrity over the physical medium.
The process can be thought of as an envelope (the frame) that carries a letter (the packet) inside it. Each network layer adds its own 'envelope' with specific information required for its operations. At the destination, these envelopes are removed in reverse order as data moves up through the layers until the original packet is delivered to the appropriate network layer application.
In apersuasive message, opposing ideas should be:
a- Cited,then refuted
b- Ignored
c- Mentioned only when necessary
d- Notmentioned
Answer:
b- Cited,then refuted
Explanation:
Citation enhances persuasion of information sources.
Refutation means understanding the viewpoint of the opposition and then countering it by providing respective evidence or by finding mistakes in the logic of the opposition's argument.
What is the decimal number of binary number 1101011 if the binaryis represented as a(n)
a. Unsigned integer
b. Signed magnitude integer
c. One’s complement integer
d. Two’s complement integer
e. ASCII character
Answer:
a. Unsigned integer 107
b. Signed magnitude integer -43
c. One’s complement integer -20
d. Two’s complement integer 21
e. ASCII character k
Explanation:
a) For unsigned integer,
We put this value in representation of binary and put binary number in it.
we will place 1, 2, 4, 8, 16, 32, 64, 128 ...(powers of two)
64 32 16 8 4 2 1
1 1 0 1 0 1 1
The positions at 1 is present,we will add those numbers.In this (64+32+8+2+1) =107 is there.
So,107 will be the representation.
b)For signed magnitude integer,
The representation is just the same,but as signed integers the first bit represent the negative number.
64 32 16 8 4 2 1
1 1 0 1 0 1 1
The first bit is for Negative(-),then we will add other number where 1 is present.In this (32+8+2+1)=43.We will add (-) due to signed integers.
So,-43 will be the representation.
c) For One's complement integer,
We will compliment the bits of binary number.At the place of 1 ,place 0 and at the place of 0,place 1.
1 1 0 1 0 1 1
Compliment 0 0 1 0 1 0 0
Then,We put this value in representation of binary and put binary number in it, we will place 1, 2, 4, 8, 16, 32, 64, 128 ...(powers of two)
64 32 16 8 4 2 1
0 0 1 0 1 0 0
The positions at 1 is present,we will add those numbers.In this (16+8)=20 we will put negative at the starting because of the compliment
So, -20 will be the representation.
d)For Two's complement integer,
After compliment of bits At the place of 1 ,place 0 and at the place of 0,place 1.Then,we add 1 bit to the Least significant bit(Lsb).
1 1 0 1 0 1 1
Compliment 0 0 1 0 1 0 0
Add 1 to Lsb 0 0 1 0 1 0 0
+ 1
Number 0 0 1 0 1 0 1
Then,We put this value in representation of binary and put binary number in it, we will place 1, 2, 4, 8, 16, 32, 64, 128 ...(powers of two)
64 32 16 8 4 2 1
0 0 1 0 1 0 1
The positions at 1 is present,we will add those numbers.In this (16+8+1)=21
So,21 will be the representation.
e. For ASCII character,
First,convert it into decimal
We multiply bits with 2^n,from ascending numbers to 0 to (n-1),and add them
= 1 * 2^6 + 1*2^5 + 0* 2^4 + 1*2^3 + 0* 2^2 + 1*2^1 + 1* 2^0
= 64+32+8+2+1
= 107
Then,we check in Ascii table 107 decimal number's position ,k is there.
So,k will be the representation.
True / False
1. A byte is a standardized unit of measure that is always 8-bits.
Answer:
TRUE
Explanation:
In telecommunication and computing, there are different units of data storage. The most commonly used units are the bit and the byte.
A bit is the capacity of the system having only two states.
Whereas, the byte, also known as octet, is equal to eight bits. The unit symbol for Byte is B. In many computers, it is the smallest addressable unit of memory.
Therefore, the given statement is TRUE.
IMUL & IDIV operate on
a. Two's complement number, b. one's complementnumber, c. all of the give option, d. none of these
Answer: a) Two's complement number
Explanation: IMUL that is referred as signed multiply which performs the multiplication operation of two operands and IDIV is the referred as the signed division which performs the division between two operands. They perform their action on the two's complement number because of their signed behavior otherwise unsigned multiplication(MUL) and division(DIV) are also present for other numbers.
int[] array1 = {1, 3, 5, 7}
for(int i =0; i
if(array1[i] > 5)
System.out.println(i +" " + array1[i]);
Which indices are in bounds for the array array1, given thedeclaration above?
0, 1, 2,3
1, 2, 3,4
1, 3, 5,7
0, 1, 3,5
Answer: 0,1,2,3
Explanation:
The array contains 4 elements that is 1,3,5,7.So the size of the array is 4.The indexing in an array starts from 0 means the element at 0 index is the first element in the array So 1 is at the index 0 and the index will increase by 1 as we move right of the array.So 3 is at the index 1 ,5 is at the index 2 and 7 is at the index 3.So the indices are 0,1,2,3.
Do you think that the power of face to face communication ismore effective than the other modes of communication?
Answer: YES
Explanation:
Face to face communication more preferred than other means of communication because in this form of communication you are able to convince someone more and also you are able to build a form of trust with the individual.
In other forms of communication there can be misunderstanding or maybe the interpretation not conceived well. So, Face to face communication more effective than other means of communication
In how many ways can the letters of the word APPROXIMATION be arranged?
Answer:
2494800
Explanation:
A lot of math and time.
In the EXACT 4SAT problem, the input is a set of clauses, each of which is a disjunction of exactly four literals, and such that each variable occurs at most once in each clause. The goal is to nd a satisfying assignment, if one exists. Prove that EXACT 4SAT is NP-complete.
Final answer:
To prove EXACT 4SAT is NP-complete, we show it's in NP and that any NP problem can be reduced to it; typically, by reducing 3SAT to EXACT 4SAT while respecting its unique constraints.
Explanation:
To prove that EXACT 4SAT is NP-complete, we can follow the standard procedure for such proofs. First, we must show that EXACT 4SAT is in NP. This is straightforward because once a candidate solution (assigning truth values to variables) is proposed, it can be checked in polynomial time whether all the clauses are satisfied. Second, we must demonstrate that every problem in NP can be polynomially reduced to EXACT 4SAT. This is often done by reducing a known NP-complete problem to EXACT 4SAT.
One possible approach is to reduce from 3SAT to EXACT 4SAT, as 3SAT is a well-known NP-complete problem. This reduction would involve taking each clause of three literals in a 3SAT instance and transforming it into one or more clauses of exactly four literals such that the transformed clauses are satisfiable if and only if the original clause is satisfiable. Care must be taken to ensure that each variable occurs at most once in each new clause. After a valid reduction is constructed, this would mean EXACT 4SAT encompasses at least the difficulty of 3SAT, confirming its NP-completeness.
We need ____ pointers to build a linked list.
A.
two
B.
three
C.
four
D.
five
Answer:
two
Explanation:
A linked list is a data structure which stores the multiple-element with data type
and a pointer that stores the address of the next element.
A linked list is a series of nodes connecting each other by a pointer.
a node contains data and a pointer.
For build an array, two pointers are used:
the first pointer for specifies the starting node called head node.
and the second pointer is used to connect the other node to build the linked list.
Both are used to build the array if we lose the head node we cannot apply the operation because we do not know the starting node and we cannot traverse the whole linked list.
for example:
1->2->3->4->5
here, 1 is the head node and -> denote the link which makes by the second pointer.
Final answer:
To build a linked list, at least two pointers are needed: one for the head of the list and another within each node to point to the next node.
Explanation:
To build a linked list, you need two pointers. The first pointer typically points to the head of the list, which is the first node in the list. The second pointer, found within each node, points to the next node in the list. This setup allows the linked list to efficiently add and remove elements, by adjusting these pointers appropriately when nodes are inserted or deleted.
In contrast to arrays, linked lists do not use contiguous memory space and they allow for efficient insertions and deletions. They can grow and shrink during the execution of a program. Each node in a singly linked list generally contains the data part and the next pointer. However, in a doubly linked list, each node contains an additional pointer, known as the previous pointer, referencing the preceding node in the sequence to allow bidirectional traversal.
What does the following function return? void index_of_smallest(const double all, int startindex, int numberOfSlots); A. a double B, numberOflots C. an integer D. nothing
Answer:
nothing
Explanation:
Because the return type of the function is void. void means does not return any thing.
The syntax of the function:
type name( argument_1, argument_2,......)
{
statement;
}
in the declaration the type define the return type of the function.
it can be int, float, double, char, void etc.
For example:
int count( int index);
the return type of above function is int. So, it return integer.
similarly,
void count(int index);
it return type is void. So, it does not return any thing.
What is Service Oriented architecture & How is it different form Object Oriented Middleware?
Answer: This can be explained s follows :-
Explanation: The approach in which services available in the network are used by the applications is called service oriented architecture. In such structure a business function is provided by each service that is independent of other services.
Object oriented programming is a programming paradigm. OOP can be used outside of that architecture or it can be apart of SOA as well .
The break statement is used with which statement?
A)at
B)for
C)nested if
D)switch
Answer:
B) for
Explanation:
The break statement is used in looping constructs to break out of the loop.
for is an example of a construct used for looping n Java.
Consider the example:
for(int i=0;i<10;o++){
System.out.print(i);
if(i==5)break;
}
In this case the output will consist of 012345 .
When loop variable i is equal to 5, the if condition will be satisfied and the loop breaks due to break statement.
Note that break is also used with switch...case blocks, but in this case it is more closely tied to the case statement.
Write a recursive method to return the number of uppercase letters in a String. You need to define the following two methods. The second one is a recursive helper method. public static int count(String str) public static int count(String str, int high) For example, count("WolFIE") returns 4.
Answer:
Recursive function with two parameters that return the number of uppercase letters in a String
public static int count(String str,int h)//Defining function
{
if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z
{
h++; //incrementing the counter
if(str.length()>=2){
return count(str.substring(1),h);//recalling function
}
}
if(str.length()>=2){
return count(str.substring(1),h); //recalling function
}
return h;
}
This is the recursive function with the name count of return type integer,having parameters str of string type and h of integer type.In this we are checking the characters at a particular position from A to Z.
Recursive function with one parameter that return the number of uppercase letters in a String
public static int count(String str)//Defining function
{
if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z
{
count++; //incrementing the counter
if(str.length()>=2){
return count(str.substring(1));//recalling function
}
}
if(str.length()>=2){
return count(str.substring(1)); //recalling function
}
return count;
}
This is the recursive function with the name count of return type integer,having parameters str of string type .In this we are checking the characters at a particular position from A to Z.
Java program that return the number of uppercase letters in a String
import java.util.*;
public class Myjava{
static int count =0;//Defining globally
public static int count(String str,int h)//Defining function
{
if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z
{
h++;
//incrementing the counter
if(str.length()>=2){
return count(str.substring(1),h);//recalling function
}
}
if(str.length()>=2){
return count(str.substring(1),h);
//recalling function
}
return h;
}
public static void main(String[] args)//driver function
{
System.out.println("Enter a string");//taking input
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
int h =0;
System.out.println("Counting the Uppercase letters: "+count(s,h));
}
}
Output
Enter a string WolFIE
Counting the Uppercase letters: 4
Final answer:
The question involves writing two methods to recursively count the number of uppercase letters in a String: a base method and a recursive helper method. The base method initiates the recursion with the string and its length, while the helper method implements the recursive logic, decrementing the count and checking for uppercase characters.
Explanation:
The question asks for the development of a recursive method to count the number of uppercase letters in a given string. This involves writing a base method count(String str) that initiates the recursion and a helper method count(String str, int high) which performs the actual recursive logic.
Method Definition
To achieve this, first, the base method needs to call the recursive helper method with the initial parameters - the string itself and the length of the string as the starting point. The recursive method will then decrement the count while checking for uppercase characters until it reaches the base case where the index (or high) is less than 0.
Example Implementation
public static int count(String str) {
return count(str, str.length() - 1);
}
public static int count(String str, int high) {
if (high < 0) {
return 0;
} else {
int count = Character.isUpperCase(str.charAt(high)) ? 1 : 0;
return count + count(str, high - 1);
}
}
In this example, count("WolFIE") will indeed return 4, as it correctly identifies 'W', 'F', 'I', 'E' as uppercase letters.
What are the field/method access levels (specifiers) and class access levels ?
Answer:
There are 5 access specifiers totally in C#
Explanation:
In C# there are 5 different access specifiers.
1. Private
2. Protected
3. Internal
4. Protected Internal
5. Public
Fields or methods can have all the access modifiers, where as classes can have only 2 (internal, public) of the 5 access specifiers.
I have explained the usage of each access modifier below.
Private :
Private members are available only with in the containing type.
Public :
Public members are available any where. There is no restriction.
Internal: Internal members are available anywhere in the containing assembly.
Protected:
Protected Members are available, with in the containing type and to the types that derive from the containing type.
Protected Internal :
These are available anywhere within containing assembly and from within a derived class in any another assembly.
Write an overloaded constructor for the Table class that will take a single argument for the color of the table Write a set method (also known as a mutator method) for the color attribute.
Explanation:
Below is required code in java :-
public class Table{
private String color; //attribute to store the color of the table
public Table(){ //default constructor
this.color=""; //set a default blank color
}
public Table(String color){ //overloaded constructor
this.color=color; //set the color value equal to the parameter provided
}
public void setColor(String color){ //setter or mutator method
this.color=color; //set the color value equal to the parameter provided
}
}
Write a program the will convert Celsius to Fahrenheit or the other way.The user is asked to enter a floating point number.The user should be asked to select the conversation that will be performed.The menu should look like the following:
C-----From Celsius to Fahrenheit
F-----From Fahrenheit to Celsius
Answer:
Output
Temperature Converter
C-----From Celsius to Fahrenheit
F-----From Fahrenheit to Celsius
Enter your choice (C or F):
C
Enter temperature in Celsius:
45
Temperature in Fahrenheit: 113.0 °F
Explanation:
Below given is a java code that will convert Celsius to Fahrenheit or the other way:-
import java.util.Scanner;
public class TemperatureConvertor {
public static void main(String[] args){
double celsius=0.0;
double fahrenheit=0.0;
String choice;
Scanner input=new Scanner(System.in);
System.out.println("Temperature Convertor");
System.out.println("C-----From Celsius to Fahrenheit");
System.out.println("F-----From Fahrenheit to Celsius");
System.out.println("Enter your choice (C or F): ");
choice=input.next();
if(choice.equals("C")){
System.out.println("Enter temperature in Celsius: ");
celsius=input.nextDouble();
fahrenheit=((9*celsius)/5)+32;
System.out.println("Temperature in Fahrenheit: "+fahrenheit+" °F");
}else if(choice.equals("F")){
System.out.println("Enter temperature in Fahrenheit: ");
fahrenheit=input.nextDouble();
celsius=(5*(fahrenheit-32))/9;
System.out.println("Temperature in Celcius: "+celsius+" °C");
}else{
System.out.println("Wrong choice !!!");
}
}
}
If a function doesn’t return a value, the word _________ will appear as its return type.
Answer: error
Explanation: the word ‘error’ will flash up