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
Sophie [7]
3 years ago
9

Creating objects of the currency class requires a name (string ), a currency symbol (string ) and the number of decimal places (

integer ) usually associated with the currency (in that order). define an object named curr, of type currency corresponding to "us dollar" with the symbol "$" and 2 decimal places.
Computers and Technology
1 answer:
Thepotemich [5.8K]3 years ago
7 0
We are given with
name = curr
currency = $
decimal places = 2

Defining the object requires declaring it as a string character. So,
string.Format("$", "{0:0.00}")

The object is string with keyword string
The format is that there is a dollar sign at the start and a number of two decimal places hence the format 0:0.00<span />
You might be interested in
g Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all
Jlenok [28]

Answer:

See explaination

Explanation:

//ReadFile.java

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class ReadFile

{

public static void main(String[] args)

{

int elementsCount=0;

//Create a File class object

File file=null;

Scanner fileScanner=null;

String fileName="sample.txt";

try

{

//Create an instance of File class

file=new File(fileName);

//create a scanner class object

fileScanner=new Scanner(file);

//read file elements until end of file

while (fileScanner.hasNext())

{

double value=fileScanner.nextInt();

elementsCount++;

}

//print smallest value

System.out.println(elementsCount+" data values are read");

}

//Catch the exception if file not found

catch (FileNotFoundException e)

{

System.out.println("File Not Found");

}

}

}

Sample output:

sample.txt

10

20

30

40

50

output:

5 data values are read

5 0
3 years ago
4.9 Code Practice: Question 4
hichkok12 [17]

total = 0

i = 0

while i < 10:

   temp = float(input("Enter Temperature: "))

   total += temp

   i += 1

print("Sum =", str(total))

I hope this helps!

7 0
3 years ago
How to use a state value in stylesheet in react native.
lana66690 [7]

Answer:

Change this code:

return <View style={[styles.container, backgroundColor: this.state.bg]}/>

for this code:

return <View style={[styles.container, {backgroundColor: this.state.bg}]}/>

3 0
2 years ago
Can we change the format of a field (e.g. Number to Dollars).
mixer [17]

I think the answer is

3 - Usually, but we may need to convert the data types (date to text)

Because we can change the format, but depends of the original format type and in what type you need to format.

I think this can help.

3 0
4 years ago
Jqiom:FNU Ojlak toiha 438oy9ctu4jmpvke,u9wjm8i
Mazyrski [523]

Answer:

dfghgfdfghgfdfghgfdfghjhgfdfghjhgfdfghjhgfghjhgferghjhre

Explanation:

3 0
3 years ago
Other questions:
  • Which one of the following is an example of hacktivism according to you and why?
    11·1 answer
  • Can someone help me with this one
    9·2 answers
  • . In testing, what is the role of an oracle?
    15·1 answer
  • Ports that are generally used to establish outbound connections are known as ___ ports.
    14·1 answer
  • What is unique about the TODAY and NOW functions?
    15·2 answers
  • Difrent between computer and computer system​
    9·1 answer
  • Create another method: getFactorial(int num) that calculates a Product of same numbers, that Sum does for summing them up. (1,2,
    7·1 answer
  • Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use loop). If at least once out of
    14·1 answer
  • Part 2: Code the Program
    12·1 answer
  • What is the primary difference among a domain model, an analysis model, and a design model for the same project?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!