Answer:
Scanner scan = new Scanner(System.in);
System.out.println("Type the message to be shortened");
String msg = scan.nextLine();
System.out.println();
msg = msg.toLowerCase();
String newStr = "";
System.out.println("Algorithm 1");
int vowels = 0;
int repeats = 0;
for(int i = 0; i < msg.length(); i++)
{
if((msg.substring(i, i +1).equals("a") || msg.substring(i, i+1).equals("e") || msg.substring(i, i +1).equals("i") || msg.substring(i, i+1).equals("o") || msg.substring(i, i +1).equals("u")))
{
if(i != 0 && !msg.substring(i -1, i).equals(" "))
{
vowels++;
}
else
newStr += msg.substring(i, i +1);
}
else if(i != 0 && msg.substring(i, i +1).equals(msg.substring(i -1, i)))
{
repeats++;
}
else
{
newStr += msg.substring(i, i +1);
}
}
System.out.println("\nAlgorithm 1");
System.out.println("Vowels removed: " + vowels);
System.out.println("Repeats removed: " + repeats);
System.out.println("Algorithm 1 message: " + newStr);
System.out.println("Algorithm 1 characters saved: " + (vowels + repeats));
algorithm2(msg);
}
public static void algorithm2(String msg)
{
String alg2Msg = "";
int uniqueLetters = 0;
// Iterate through each letter in msg
for(int i=0; i < msg.length(); i++)
{
String ltr = msg.substring(i,i+1);
// Only process if this character is not a space
if(!ltr.equals(" "))
{
/* Check whether this character has already appeared by
* iterating through characters from start up to the current
* letter and using a boolean flag variable.
*/
boolean alreadyUsed = false;
for(int j=0; j<i; j++)
{
if(msg.substring(j,j+1).equals(ltr))
{
alreadyUsed = true;
}
}
/* If this character hasn't already appeared,
* iterate through the rest of the characters
* and count how many times it appears.
*/
if(!alreadyUsed)
{
uniqueLetters++;
int count = 0;
for(int j=i; j<msg.length(); j++)
{
if(msg.substring(j,j+1).equals(ltr))
{
count++;
}
}
alg2Msg += count + ltr;
}
}
} //end for loop
System.out.println("\nAlgorithm 2");
System.out.println("Unique characters found: " + uniqueLetters);
System.out.println("Algorithm 2 message: " + alg2Msg);
System.out.println("Algorithm 2 characters saved: " + (msg.length() - alg2Msg.length()));
} //end algorithm2
}
Explanation:
Here you go!
Why did England establish the Sugar Act?
Answer:
The Revenue Act of 1764, also known as the Sugar Act, was the first tax on the American colonies imposed by the British Parliament. Its purpose was to raise revenue through the colonial customs service and to give customs agents more power and latitude with respect to executing seizures and enforcing customs law.
Explanation:
Hope this helps- Good luck ^w
NEED HELP ASAP JAVA
multiple choice
How many times will the following loop repeat?
int num = 49;
while (num > 0)
{
if (num % 2 == 0)
{
num++;
}
else
{
num--
}
}
A. 21
B. 22
C. 20
D. Infinite Loop
E. 23
Pls Help need it before 1pm PLS.
Before taking a photograph, which of the following should you check?
The time of day
The weather report
That the colors in the photograph do not clash
That the lines in the photograph are straight
Answer:
Explanation:t
the weather
The weather report should you check. Therefore option B is correct.
Before taking a photograph, checking the weather report is important to ensure favorable conditions for capturing the desired shot. Weather can significantly impact the outcome of a photograph.
For instance, bright sunlight might cause harsh shadows or overexposure, while a cloudy day may provide softer, more diffused lighting.
Additionally, weather conditions like rain or strong winds can affect the feasibility and safety of the photo shoot.
By checking the weather report beforehand, photographers can plan accordingly, choose suitable equipment, and make adjustments to achieve the best possible results.
Considering the weather helps to avoid potential issues and enhances the overall quality and success of the photography session.
Therefore option B The weather report is correct.
Know more about The weather report:
https://brainly.com/question/18196253
#SPJ6
Worms and Trojans are typically harmless because the originator of such attacks are usually known to the recipient, and as such, are not intended to cause much harm.
(A) True
(B) False
Answer:
False
Explanation:
Viruses, worms and trojans are all malicious programs that can damage your computer. Also i got an A soo...
Which statements describe an If statement? Check all that apply.
A conditional If statement is used when the programmer wants decision-making included in the
code.
A conditional If statement executes code when the condition returns a value of false.
A conditional If statement executes a piece of code when one statement is false and the following
statement is true.
A conditional If statement tests whether the condition following it is true or false before executing a
specified part of the code.
Answer:
A and D
Explanation:
The that describe an If statement are;
A conditional If statement is used when the programmer wants decision-making included in the code.A conditional If statement executes code when the condition returns a value of false.A conditional If statement tests whether the condition following it is true or false before executing a specified part of the code.According to this question, we are to discuss about If statement .
As a result of this we can see that conditional If statement is used when the programmer wants decision-making included in the cod.
Therefore, If statement executes code when the condition returns a value of false
Learn more about If statement at;
https://brainly.com/question/18736215
Why does it not let me see my messages? In brainy?
Answer:
Was removed you can only message the brain
Explanation:
give some examples of technologies that have improved human living conditions
Answer:
Apps. Apps are a very well-known example of eHealth; most people have tried out an app to improve their mental or physical health at least once. ...
Wearables. Maybe you possess or have seen people wearing devices like the Apple watch, Fitbit, or Pebble. ...
Websites. ...
Virtual Reality. ...
Videoconferencing.
Explanation:
PLEASE HURRY!!
Look at the image below
Answer:
The function usernameMaker.
Explanation:
strFirst is a local variable in the function usernameMaker since it is an argument that is passed into that function. This means that the scope of strFirst is the function usernameMaker, since it cannot be accessed anywhere else in the code.
Hope this helps :)
help please!! worth 10 pts! answer quick please!
Answer:
it has helped the people of today by
1.helped the young generation with there homework
2.you can book an hotel through the internet
3.you can also book a plane ticket via the internet
4.it is easier to look to ur email message via the internet
Why is it important to perform routine computer maintenance? It can make more room for junk files and downloadable programs. It can help prevent hardware, software, and Internet access problems. It can stop computer problems from occurring more than once. It can help you remember how to perform steps to solve computer problems.
b :D
hope this helps
plz give me brainliest
only typed tht so i can have enough words lol
Answer:
B. It can help prevent hardware, software, and Internet access problems.
Explanation: trust dawg
PLS HURRY!!
Look at the image below
Answer: 1. for
2. while
Explanation:
Hey i have a question i have Iphone and there’s no feature for the tutor? But on my dad”s samsung there is?
A _______ web page's content can change based on how the user interacts with it.
Answer:
Dynamic web page shows different information at different point of time.
Write a java program with the following instruction:- class name: prime, instance variable: int n. Member methods:-
prime(): default constructor to initialize n
void input(int x): to assign n with x,
void display(): to check whether the number is prime or not
class Prime {
int num = 1;
boolean flag = false;
public void input(int x) {
this.num = x;
}
public void display() {
for (int i = 2; i <= num / 2; ++i) {
// condition for nonprime number
if (num % i == 0) {
flag = true;
break;
}
}
if (!flag)
System.out.println(num + " is a prime number.");
else
System.out.println(num + " is not a prime number.");
}
}
May be some bugs as it is an untested code written using a mobile phone
PLEASE HURRY!!
Look at the image below
When writing research questions, use action words, such as
Answer: Effect
Explanation:
Research questions are demonstrated as the questions that directs or specifies the dimension of the research for a particular work and helps to determine the objectives of the paper or essay.
As per the question, while writing or farming research questions, action verb like 'effect' must be used as it would help determine the impact of a particular research question on the content and efficacy of the research and thus, frame questions that propose a clear, concise, intricate, and debatable thesis statement and offer an effective dimension to the essay that creates a valid impact on the audience.
Answer:
yes
Explanation:
because that helps to understand the text or article more
Which type of worker tends to earn the highest pay in comparison to the others? Science, Technology, Engineering, and Math Workplaces and Tasks
Answer:
All those options, just described computer science so be specific.
8. A sprite is a simple spider shaped thing with n legs coming out from a center point. The angle
between each leg is 360 / n degrees.
Write a program to draw a sprite where the number of legs is provided by the user.
For example, when the user enters 6, they should get the following output
import turtle
s = turtle.Screen()
t = turtle.Turtle()
t.penup()
t.goto(0,-10)
t.pendown()
t.fillcolor("black")
t.begin_fill()
t.circle(10)
t.end_fill()
legs = int(input("How many legs do you want your sprite to have? "))
i = 0
angle = 360 / legs
while i < legs:
t.penup()
t.goto(0,0)
t.pendown()
t.forward(30)
t.back(30)
t.right(angle)
i += 1
s.mainloop()
You might need to adjust this to your liking. I was able to do everything but draw the triangles at the end of each leg. I hope this helps though.
Suppose that you use a 220 Ohm resistor as the fixed resistor in your Arduino burglar alarm.
Suppose that the photoresistor is the same one we used in our last homework assignment, where the resistance is 500 Ohms when it is fully illuminated by light, and 180 kiloOhms when it is in darkness.
What would the input voltage be to the Arduino when it is fully illuminated if we connect the Arduino so that its analog input pin "sees" the same voltage difference that the photoresistor has across it.
In the previous problem, what would the input voltage be to the Arduino when it is darkness if we connect the Arduino so that its analog input pin "sees" the same voltage difference that the photoresistor has across it.
Different types of light detectors are LDRs or Light Dependent Resistors Photo . First you need to connect the LDR to the analog input pin 0 on the Arduino. If intensity of light falling on LDR is high LDR will have low resistance
Select the correct answer.
Manuel is writing a sales proposal using a word processor. He wants his company's logo to appear at the top of each page of the proposal
document. Which tool of the word processor should he use?
A)Footer
B)Orientation
C)Header
D)Margins
Answer: it is c
Explanation: that is the only thing that would be at the top
2. Which of the following statements describes a need or problem that can be solved using the technology design process.
O A family needs a garage door that will automatically open when their car approaches.
A family needs to determine how to assign chores in the most fair manner
O A baseball player needs to improve his batting skills
A community needs to decide to install a new swimming pool or update the park
Answer:
The Family with the garage door
Explanation:
I could swear that that's the same question on my quiz. :o
Answer:
A family needs a garage door that will automatically open when there car approaches.
Explanation:
I did my test and knew it was this but i searched this up to see if i could get points and help LOL so this is 100% correct!
Which of these appliances can be classified as a robot? You can choose 2.
washing machine
sliding window
humidifier
a table lamp
ice cream vending machine
Answer:
ummmm i think b
Explanation:
the first two are washing machine and humidifier
You defined a book data type.
class book:
title = ''
author = ''
pages = 0
Then, you created an instance of your book.
myBook = book()
Which statement assigns a value to the title?
title = 'To Kill a Mockingbird'
myBook.title('To Kill a Mockingbird')
myBook.title = 'To Kill a Mockingbird'
myBook.book.title = myBook.title = 'To Kill a Mockingbird'
Answer:
myBook.title = 'To Kill a Mockingbird'
Explanation:
Correct answer edge 2020
What function text would you use to put today's date and time in a cell? =TODAY()
=NOW()
NOW()
TODAY()
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The correct answer to this question is:
=NOW()
Now() is a function that you can use to put today's date and the current time in a cell. While Today() function is a function that can only be used to put today's date.
Other options are not correct because:
If you write NOW() and TODAY() as it is in a cell, then Excel will not consider them as a function. To write a function in a cell, you have to write the "=" symbol before the function name. If you will emit the "=" symbol before the function, then the function name will be consider as text in a cell.
Answer:
B. =NOW()
Explanation:
edg 2020
Need help fast this is do a 4
Answer:
I believe the answer is B.
What can happen if you do not follow the directions when cooking or baking? (Give 4 examples in a sentence each)
Answer: 1: You will make it incorrectaly 2: It will taste terrible 3: You may break appliences 4: you may burn down your house.
Explanation:
A hash function is taking an input string of arbitrary length and produces a fixed-sized, short output called a digest.
A. True
B. False
Answer:
A. True
Explanation:
Digest is actually: a message digest algorithm, or put simply: a hash value, even simpler: the output.
Sophie used the software development life cycle to write a new program. Sophie planned her program using pseudocode and then wrote her actual code. Which stage of the software development life cycle is Sophie ready for next?
The stage of the software development life cycle that Sophie is ready for next is Building (software development)
What Is the Software Development Life Cycle?Software Development Life Cycle is known to be a kind of application of laid down business practices to create software applications.
It is said to be divided into;
Planning RequirementsDesign BuildDocument Test DeployMaintain.Learn more about software development from
https://brainly.com/question/25310031
Answer:
Testing
Explanation:
I did it on my test!
which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
a) Section break before
b) Do not hyphenate
c) Keep the next
d) Keep lines together
Answer:
Explanation: keep lines together
what is the purpose for using proper markup language
Answer:
n computer text processing, a markup language is a system for annotating a document in a way that is syntactically distinguishable from the text, meaning when the document is processed for display, the markup language is not shown, and is only used to format the text.
Explanation:
hold up reen deen ding ding ding ding
Answer:
Without the right tags the content wont be accurately indexed
Explanation:
ap3x approved
hope it helps