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

Write a Java program that takes as input a paragraph as a String and identifies if any of the words in the paragraph is a $1.00

word. The value of each word is calculated by adding up the value of each one of its characters. Each letter in the alphabet is worth its position in pennies i.e. a
Computers and Technology
1 answer:
Verizon [17]3 years ago
4 0

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Enter paragraph: ");

 String para = input.nextLine();

 String[] para_words = para.split("\\s+");

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

     para_words[i] = para_words[i].replaceAll("[^\\w]", "");

     char[] eachword  = para_words[i].toCharArray();

     int penny = 0;

     for(char c : eachword){

         int value = (int)c;

         if(value<=122 && value>=97){   penny+=value-96;     }

         else if(value<=90 & value>=65){  penny+=value-64;  }

     }

     if(penny == 100){

         System.out.println(para_words[i]);

     }

       penny = 0;

}

}

}

Explanation:

<em>Due to the length of the explanation, I've added the explanation as an attachment</em>

Download txt
You might be interested in
Which aspect of business does accounting measure?
VladimirAG [237]

financial aspect

Accounting measurement is the computation of economic or financial activities in terms of money, hours or other units. An accounting measurement is a unit of some measurable element that is used to compare and evaluate accounting data. Accounting is often measured in terms of money.

6 0
3 years ago
If I were to install python in kali linux on a Acer 11 Chromebook and C730 would I be able to hack python with it since I have n
Mazyrski [523]

Python isnt usually used for hacking because of it not being compiled and being slow etc. But with the correct code and training you should be able to hack with it if thats what you mean.Sorry for giving a low quality answer but your question should be clarified more.

5 0
3 years ago
What can you hold in your left hand but not in your right? for creese7911 and maranda66
Drupady [299]

Answer:

You're right hand or Left too

Explanation:

Because some people can hold some stuff on there hands

8 0
3 years ago
Read 2 more answers
Can someone help me on a 60 second ringtone :(
Lesechka [4]

Answer:

If you have an apple phone, its as easy as importing it into Garage Band, cutting it to size, and exporting it as a ringtone or even a text tone. My text tone is now Megalovania.

5 0
3 years ago
An initialization expression may be omitted from the for loop if no initialization is required.
stealth61 [152]

Answer:

True

Explanation:

for loop is used to repeat the process again and again until the condition not failed.

syntax:

for(initialize; condition; increment/decrement)

{

    Statement

}

But we can omit the initialize or condition or increment/decrement as well

the syntax after omit the initialization,

for( ; condition; increment/decrement)

{

    Statement

}

The above for loop is valid, it has no error.

Note: don't remove the semicolon.

You can omit the condition and  increment/decrement.

and place the semicolon as it is. If you remove the semicolon, then the compiler show syntax error.

5 0
4 years ago
Other questions:
  • Thomas is using a drawing program to complete a construction. Which construction could he be completing? (5 points).
    5·2 answers
  • What commands will reset a network interface in Linux?
    13·1 answer
  • The area on your screen where you can access the tab and menu options for word is called what?
    8·2 answers
  • The Domain Name Service is what translates human-readable domain names into IP addresses that computers and routers understandA.
    11·1 answer
  • You just bought a new hard drive for your computer to replace your primary hard drive. After backing your data up and, then, ins
    8·2 answers
  • Which of the following are input devices? Check all that apply.
    9·2 answers
  • Which types of file formats are the best choice for files that may need to be edited later?
    14·1 answer
  • When you click on what will happen?
    12·1 answer
  • A citizen of any group has both _____ and _____.
    10·1 answer
  • Which communication technology often takes the place of printed interoffice communication?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!