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
Help me guys pleassssssssse​
Readme [11.4K]

Answer:

is there a word bank??

Explanation:

8 0
3 years ago
Network a0 is a process by which several protocols evolve to form a single product.
mafiozo [28]

Answer:

Convergent network

Explanation:

In networking, computers devices are connected together to communicate and share resources. Devices like routers and switches are examples of intermediate network devices and computers, smartphones, tablets and IP phones are all examples of end devices in a network.

In the past, dedicated networks are installed for separate voice, text and video packets. But as information technology evolves, one network is used for all three packets. This network is called convergent network.

6 0
3 years ago
How are natural systems and engineered systems similar to one another?
erastovalidia [21]

They get the idea from nature and then the make engineered systems.That is how they are similar.

4 0
3 years ago
When implementing best practices, you will use external standalone firewalls whenever possible, but you won't go without a built
Andrews [41]
The answer is true

Technically, we have two types of firewall, a one way firewall and a two way. A one-way firewall will protect you from incoming threats. A two-way built-in or standalone firewall will add another layer of protection and thus, it is a must have tool.


8 0
3 years ago
What special case exists when managing linked lists?
tiny-mole [99]

Explanation:

The special case that exists in linked list when we are managing them is when we are dealing with the first element of the list.

When we create a linked list we create a first node separately.

If we delete or add element in front of the first element we have to carefully handle that case.

Hence the special case is when we are dealing with the first element of the list.

6 0
3 years ago
Other questions:
  • 4. The NIMS Management Characteristic of Chain of Command and Unity of Command means that each person: A. Continues to report di
    9·1 answer
  • The array s of ints contain integers each of which is between 1 and 1000 (inclusive). write code that stores in the variable ord
    9·1 answer
  • Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe mor
    14·1 answer
  • What is the fastest way to locate a record for updating?
    6·1 answer
  • 2(x-5)-3(3-x)=1/2(x-2)
    9·1 answer
  • What is the unit used to describe the intensity of sound?
    5·1 answer
  • What do you think is the most fascinating aspect of the Internet
    5·2 answers
  • Can anyone help me this is due today :) <br> Thank you so much
    14·2 answers
  • What is used to accurately position objects on the slide using a single horizontal and vertical line that intersects in the cent
    5·2 answers
  • You do not have to move your fingers to click the top row reach keys.<br> 1. True <br> 2. False
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!