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]
2 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]2 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
Name any extension of MS word.
Svetradugi [14.3K]
Name any extension of MS word.

.doc
8 0
3 years ago
Read 2 more answers
When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
xxMikexx [17]
<span>D - graphical user interface</span>
5 0
3 years ago
Consider the following class definitions.
Serggg [28]

Answer:

The correct answer is option A

Explanation:

Solution

Recall that:

From the question stated,the following segments of code that should be used in replacing the /* missing code */ so that the value 20 will be printed is given below:

Android a = new Android(x);

a.setServoCount(y);

System.out.println(a.getServoCount());

The right option to be used here is A.

4 0
3 years ago
?an ip address reservation is made by creating an association between an ip address and what type of client identifier?
victus00 [196]
The ethernet address, a.k.a. mac address. That way, a DHCP server can give the same IP address to a returning client.
3 0
3 years ago
You can add multiple worksheets to a workbook by clicking the home tab on the ribbon, pressing and holding ____, and then clicki
koban [17]
<span>You can add multiple worksheets to a workbook by clicking the home tab on the ribbon, pressing and holding shift , and then clicking the number of existing worksheet tabs that correspond with the number of sheets you want to add, clicking the insert list arrow in the cells group on the home tab, then clicking insert sheet.</span>
4 0
3 years ago
Other questions:
  • When inside a closed work environment, its okay to openly talk with co-workers about PII
    6·1 answer
  • The material chosen for your study group
    11·1 answer
  • What part of the computer gives access to the internet
    10·1 answer
  • What is the purpose of the print area feature​
    11·1 answer
  • If you are working on a document and want to have Word automatically save the document every minute, what steps should you use t
    13·1 answer
  • Where is line-of-sight Internet common?<br> In space<br> Outdoors<br> Inside<br> In businesses
    5·1 answer
  • When a block of steel at 90 degrees Celsius is placed in a bucket of water at 30 degrees Celsius, what happens?
    10·1 answer
  • I need help!!!! 1.04
    9·1 answer
  • Anyone want to play mine mincraft w/ me?
    9·1 answer
  • I need help with this question.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!