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
Marat540 [252]
3 years ago
8

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
Computers and Technology
1 answer:
hodyreva [135]3 years ago
6 0

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.

You might be interested in
In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. For in
MakcuM [25]

Answer:

See explaination for program code

Explanation:

package com.company;

import java.io.IOException;

import java.nio.file.Files;

import java.nio.file.Paths;

import java.util.Stack;

/*

* A program which reads input from given text filename and prints

* whether it passed the pre-processing stage or not

* Sample input

* int A = (a + b);static void display(int x)

* {

* //A sample input file

* }

* */

public class MyPreprocessor {

/*

* Reads input from filename and returns a string

* containing whole text

* */

public String readInput(String filename) {

String content = "";

try {

content = new String(Files.readAllBytes(Paths.get(filename)));

} catch (IOException e) {

e.printStackTrace();

}

return content;

}

/**

* Filters input since we are only concerned with

* a subset of input = '{}[]()/*'

*/

public String filterText(String text) {

String output = "";

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

switch (text.charAt(i)) {

case '[':

case ']':

case '{':

case '}':

case '(':

case ')':

case '*':

case '/':

output += text.charAt(i);

}

}

return output;

}

/*

* Uses stack to determine if input is valid or not

* */

public boolean parse(String input) {

Stack<Character> St = new Stack<Character>();

// '$' is special symbol to represent bottom of stack

St.push('$');

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

Character symbol = input.charAt(i);

if(St.peek().equals(getOpenSymbol(symbol)))

St.pop();

else St.push(symbol);

}

return St.peek() == '$';

}

private static Character getOpenSymbol(Character symbol) {

switch (symbol) {

case '}': return '{';

case ']': return '[';

case ')': return '(';

case '*': return '*';

case '/': return '/';

default: return ' ';

}

}

public static void main(String[] args) {

MyPreprocessor preprocessor = new MyPreprocessor();

String inputText = preprocessor.readInput("src/input.txt");

String filteredInput = preprocessor.filterText(inputText);

if(preprocessor.parse(filteredInput))

System.out.println("preprocessing passed.");

else System.out.println("preprocessing failed!");

}

}

6 0
3 years ago
Win10如何删除自己添加的环境变量?...............
Paha777 [63]

Answer:

方法/步骤

右键单击以选择此计算机,然后有一个菜单来选择属性。

选择后,打开属性面板以找到我们的高级系统设置。

打开后,我们在系统设置下找到高级设置。

打开后,我们看到下面有一个环境变量选项。

打开后,我们在右下角看到一个删除选项。

单击删除到,在右下角后单击删除,然后单击确定的选项。 ...

本文未经授权摘自百度经验

8 0
2 years ago
What is a command-line interactive scripting environment that provides the commands for almost any management task in a Windows
hoa [83]

Answer:

kqwbxskwsxe

Explanation:

menb dhj

8 0
3 years ago
(photoshop cc)
iren2701 [21]
Black Point<span> Compensation option </span>controls whether to adjust for differences in black points when converting<span> colors </span>between color spaces<span>.

A is the answer :)

</span>
5 0
3 years ago
I had about 83 GB before I installed Xcode, I was in the middle of the installation and reconsidered my decision but it's still
Natasha_Volkova [10]

You can try downloading some kind of computer cleaner like CleanMyMac X free version, also definitely restart your computer if you haven't done so already.

4 0
2 years ago
Read 2 more answers
Other questions:
  • . (a) Prove or disprove carefully and in detail: (i) Θ is transitive and (ii) ω is transitive. (b) Assume n is a positive intege
    15·1 answer
  • Will an email sent from a phone say it was sent from your phone
    5·2 answers
  • Can someone help me with...A table can help? PLEASE
    8·1 answer
  • Solve the recurrence relation.<br> S(1)=1<br> S(n)= S(n-1)+(2n-1) for n&gt;=2
    13·1 answer
  • What does the internet engineering task force (IEFT) do?
    5·1 answer
  • Among the eight unique features of​ e-commerce, which is related to the ability to interact with web technology​ everywhere?
    14·1 answer
  • Application software can run without the presence of system software true or false ​
    5·1 answer
  • How can i fix a all white phone screen
    11·2 answers
  • What are the four steps for planning a table?​
    10·1 answer
  • What are input masks most useful for in data validation? moving data from one field to another hiding parts of a value that are
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!