Answer:
print("${:,.2f}".format(5242.83))
Explanation:
Given
$5,242.83
Required
Use an f string to output the above
The syntax of an f-string to format a number in that regard is: "${:,.2f}".format(number)
$ means that a dollar sign be printed before the required number
., means that the number be separated with commas
2f means that the number be presented in 2 decimal places
So:
"${:,.2f}".format(number) becomes
"${:,.2f}".format(5242.83)
In a print statement, the full instruction is:
print("${:,.2f}".format(5242.83))
1, How can technology serve to promote or restrict human rights? [2 points]
Answer:
Examples of how technology can be used as a powerful tool for human rights are ever expanding. Newer technologies such as artificial intelligence, automation, and blockchain have the potential to make significant positive contributions to the promotion and protection of human rights.
I need help Asap!!! So the question is "Compare and contrast Web page and Websites".
Answer:
A website is a mix of web pages while a web page is a single entity.
Explanation:
when working with smart which tab would provide the ability to change the shape or size of the smart art shapes
Answer:
B) Format
Explanation:
Write code to take two words from the user. The program should convert these to lower case, then compare them: printing a positive number if string1 appears after string2 alphabetically, a negative number if string1 appears before string2 alphabetically and zero if the two strings are identical. Make sure your program does not produce any additional numerical output other than this number or it may not be graded correctly.
Answer:
Use compareTo.
Explanation:
import java.util.Scanner;
public class U2_L3_Activity_Three{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("Enter first word: ");
String word1 = scan.nextLine();
System.out.println("Enter second word: ");
String word2 = scan.nextLine();
//I had to make the string all lowercase or all uppercase for when I did this
word1 = word1.toLowerCase();
word2 = word2.toLowerCase();
System.out.println("Result: " + word1.compareTo(word2));
}
}
Following are the program to converting string value into lowercase and compare with an input string value.
Program Explanation:
Import package.Defining a class Dat.Inside the class defining the main method, and in the method, two string variable "string1, string2" is declared.After input, the value a "toLowerCase" method is used that converts string value into lower case. After converting value into the lower case a "compareTo" method is used that compares value and prints its value.Program:
import java.util.*;//import package for input
public class Dat //defining a Dat
{
public static void main(String[] ax)//main method
{
String string1 ,string2; //defining String variable
Scanner sc = new Scanner(System.in);//creating Scanner class object to input value
System.out.println("Enter values: ");//print message
string1= sc.next();//input value
string2= sc.next();//input value
string1= string1.toLowerCase();//convert string value into LowerCase
string2 = string2.toLowerCase();//convert string value into LowerCase
System.out.println("Result: " + string1.compareTo(string2));//using compareTo method
}
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/15706308
Methods ii.) Define and implement a method that takes a string array as a parameter and returns the length of the shortest and the longest strings in the array i.) Write a method that take an integer array as a parameter and returns the sum of positive odd numbers and sum of positive even numbers. iii.) Implements the sequential search method that takes and array of integers and the item to be search as parameters and returns true if the item to be searched in the array, return false otherwise
Answer:
Explanation:
Well I am sorry I don't know the answer anyway.