1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
laiz [17]
3 years ago
9

Write a java program to input the corresponding data to print the result of the following expression

Computers and Technology
1 answer:
Anna71 [15]3 years ago
6 0

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 float a, b, c, x, y;

 a = input.nextFloat();

 b = input.nextFloat();

 c = input.nextFloat();

 x = input.nextFloat();

 y = a * x * x + b * x + c;

 System.out.print(y); }}

Explanation:

This declares all variables

 float a, b, c, x, y;

The next 4 lines get input for a, b, c and x

<em>  a = input.nextFloat();</em>

<em>  b = input.nextFloat();</em>

<em>  c = input.nextFloat();</em>

<em>  x = input.nextFloat();</em>

This calculates the value of y using y = ax^2 + bx + c

y = a * x * x + b * x + c;

This prints the calculated value of y

 System.out.print(y);

You might be interested in
A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
Elena L [17]

Answer:

The most likely reason for this error is that the share is currently not available either on just the user’s computer or server-wide. The next step would be to check for the scope of the problem.

5 0
3 years ago
Which is an advantage of using a flat file instead of a relational database?
Romashka-Z-Leto [24]

Answer:

An advantage of using a Flat file instead of a relational database is;

A Flat file is easier to set up

Explanation:

The Flat file database is a database developed by IBM and it is the primary type of database for storing data in text files such as in Microsoft Excel

Individual database records are stored in a line of plain text and are separated from other records by delimiters including commas and tabs

The advantages of a Flat file database are;

1) The records of the database are stored in a single place

2) A Flat file is easier to set up with Microsoft Excel or other office applications

3) The Flat file database is easier to comprehend and understand

4) The records of the database can be simply stored

5) Simple criteria can be used for viewing or extracting data from a Flat file database

6 0
3 years ago
Which of these loops will initialize each element in the array ar to hold the value 4 ?A. for (int i = 1; i &lt; ar.length; i++
Dima020 [189]

Answer:

Option (d) is correct.

Explanation:

In java language "ar.length" is used to tells the size of the array. The array is used to declare more than one variable. Its index value is started from 0. so when a user needs to initialize the value of an array, they need to start the index value at 0. because ar[0] indicates the first variable of an array.

In option (d), index value is started from 0 and ends with (array_size-1). so it gives the accessed to all the variable of an array and the statement "ar[i]=4;", initialize the value 4 to all array variable.  

while another option is not valid because--

  • In option a, Index value starts from 1 which accesses the second variable of an array.
  • In option b, the statement "i<= ar.length;", gives an unbound array exception because it took the size greater than the array size.  
  • In option c, statement "i<ar.length-1;", can not give accessed to the last element of an array.

8 0
4 years ago
What output will the LOOKUP rmula below produce in relation to the following table?
Lana71 [14]

Answer:

The correct answer is (C)-Rainly

Explanation:

The following data is given in this question

Column A    Column B

3.25             Clear

3.91              Cloudy

4.23             Windy

4.67              Rainy

5.12               Snowy

5.98              Sunny

As we know that the Microsoft Excel LOOKUP function returns a value from a range (one row or one column) or from an array.

The use of lookup function is given below

LOOKUP(4.67,A1:A6,B1:B6)

When you execute this function on the given ranges , then it display "Rainly" as a result.

Furthermore, the complete example is attached with this solution

3 0
3 years ago
Your smartphone or tablet may require you to enter a short personal identification number, or PIN. This may be any number in a r
matrenka [14]

Answer:

#include <iostream>

using namespace std;

void crack_pin(string a, int low, int res)

{

if (low == res)

 cout<<a<<endl;

else

{

 for (int i = low; i <= res; i++)

 {

  swap(a[low], a[i]);

  crack_pin(a, low+1, res);

  swap(a[low], a[i]);

 }

}

}

int main()

{

string str = "ABC";

cout <<"Enter pin guess"<<endl;

getline(cin,str);

int n = str.size();

crack_pin(str, 0, n-1);

return 0;

}

Explanation:

Take pin guess  from user using getline method in str variable of type string.

Find size of pin guess.

Declare a function crack_pin and send string, starting (0) and ending (n-1) to function.Call the function recursively to find all combinations.If start=end print string else call function again.

8 0
3 years ago
Other questions:
  • You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
    12·1 answer
  • What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
    12·2 answers
  • What are the first steps that you should take if you're unable to get onto the internet
    13·2 answers
  • Prompt the user for a character and the height of a right triangle. Then, print a triangle of that height using the character en
    11·1 answer
  • The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for ____ PC file systems.
    6·1 answer
  • What is technology??
    12·1 answer
  • Which spreadsheet toolbar displays options such as Cut and Paste?
    11·2 answers
  • _____ is confirming the significance of what another person is feeling.
    9·2 answers
  • Need help completing this coding assignment.
    11·1 answer
  • Rudy accidentally sent a sensitive work report to a personal friend named James instead one of his co-workers, who is also named
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!