I need this code to print in reverse without spaces. please help....

example:
input: dog is pretty
output: ytterpsigod


import java.util.Scanner;

// Class
class Main {

// Main driver method
public static void main(String[] args)
{

Scanner input = new Scanner(System.in);
System.out.print("input the string sentence: ");
String words = input.nextLine();

String callM = reverseFor(words);

System.out.println(callM);



}


public static String reverseFor (String str2)
{


String reversedString = "";
String count = "";
for (int i = str2.length()-1; i>=0; --i) {
reversedString = reversedString + str2.charAt(i);
if (!Character.isWhitespace(reversedString))
{
count = count + reversedString;

}
}

return reversedString;
}
}

Answers

Answer 1
Certainly! I see that you want to modify the provided code to print the reversed string without spaces. Here’s an updated version of the code that achieves that:

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the string sentence: ");
String words = input.nextLine();

String reversedString = reverseWithoutSpaces(words);
System.out.println(reversedString);
}

public static String reverseWithoutSpaces(String str) {
String reversedString = "";
for (int i = str.length() - 1; i >= 0; i--) {
if (!Character.isWhitespace(str.charAt(i))) {
reversedString += str.charAt(i);
}
}
return reversedString;
}
}

With this updated code, the reverseWithoutSpaces method iterates over the characters of the input string in reverse order and appends non-space characters to the reversedString. Finally, the reversed string without spaces is returned and printed.

Related Questions

Once a customer orders a burger they are prompted on the order screen to select which of three condiments and one to the sandwich which quality of automation is being performed here

Answers

Answer:

The quality of automation being performed here is the process of decision-making or selection based on predefined options. In this case, the customer is prompted to select from a set of three condiments and one type of sandwich, which are predefined options. This process is automated as the customer is presented with a screen with the options to select from, which is pre-programmed and does not require any manual intervention from a human. This helps to streamline the ordering process and reduce errors by providing a set of standardized options for customers to choose from.

Question 7 (1 point)
Which of the following describes what the hotkey C does when using the Knife Tool
in Blender?
It ignores the default snap to nearby edges and vertices.
It cuts the object through the visible front faces and the faces that are not
visible.
It turns on the angle constrain so cuts snap to a set 45° angle.
It snaps the cursor to the exact midpoint of the edge so the user does not have
to find it.

Answers

The hotkey C does when using the Knife Tool in Blender is: It turns on the angle constraint so cuts snap to a set 45° angle.

When using the Knife Tool in Blender, pressing the C key activates the angle constraint feature. This means that any cuts made with the Knife Tool will snap to a set 45° angle. The angle constraint feature is particularly useful when precision is required, as it allows the user to create clean and accurate cuts along specific angles without the need for manual adjustment.By default, the Knife Tool in Blender does not ignore snap to nearby edges and vertices, and it does not cut the object through only the visible front faces and non-visible faces. The functionality described in the remaining options is not related to the C hotkey in the Knife Tool.It's important to note that the information provided here is based on the Blender software as of September 2021. As software updates may occur beyond this date, it's always recommended to consult the official Blender documentation or the latest resources to confirm any changes or additions to the features and hotkeys in Blender.

The correct option is: It turns on the angle constraint so cuts snap to a set 45° angle.

For more such questions on Knife Tool

https://brainly.com/question/17959031

#SPJ8

Need help with this python question I’m stuck

Answers

It should be noted that the program based on the information is given below

How to depict the program

def classify_interstate_highway(highway_number):

 """Classifies an interstate highway as primary or auxiliary, and if auxiliary, indicates what primary highway it serves. Also indicates if the (primary) highway runs north/south or east/west.

 Args:

   highway_number: The number of the interstate highway.

 Returns:

   A tuple of three elements:

   * The type of the highway ('primary' or 'auxiliary').

   * If the highway is auxiliary, the number of the primary highway it serves.

   * The direction of travel of the primary highway ('north/south' or 'east/west').

 Raises:

   ValueError: If the highway number is not a valid interstate highway number.

 """

 if not isinstance(highway_number, int):

   raise ValueError('highway_number must be an integer')

 if highway_number < 1 or highway_number > 999:

   raise ValueError('highway_number must be between 1 and 999')

 if highway_number < 100:

   type_ = 'primary'

   direction = 'north/south' if highway_number % 2 == 1 else 'east/west'

 else:

   type_ = 'auxiliary'

   primary_number = highway_number % 100

   direction = 'north/south' if primary_number % 2 == 1 else 'east/west'

 return type_, primary_number, direction

def main():

 highway_number = input('Enter an interstate highway number: ')

 type_, primary_number, direction = classify_interstate_highway(highway_number)

 print('I-{} is {}'.format(highway_number, type_))

 if type_ == 'auxiliary':

   print('It serves I-{}'.format(primary_number))

 print('It runs {}'.format(direction))

if __name__ == '__main__':

 main()

Learn more about program on

https://brainly.com/question/26642771

#SPJ1

la doxeada pal que le caiga

Country Name United States of America
ISO-3166-1 Alpha-2 Code US
ISO-3166-1 Alpha-3 Code USA
ISO-3166-1 Numeric Code 840
Continent North America
Capital Washington, D.C.
Demonym Americans
Total Area 9,826,675
Population 331,002,651
IDD Code 1
Currency Code USD
Currency Name United States Dollar
Currency Symbol $
Language Code EN
Language Name English
TLD Code us

Answers

The United States of America (USA) is a North American country with Washington, D.C. as its capital. It has a total area of 9,826,675 square kilometers and a population of 331,002,651. The country's ISO codes are US, USA, and 840, and its currency is the United States Dollar (USD).

The United States of America (USA) is a country located in North America. It is identified by the ISO-3166-1 Alpha-2 code "US," Alpha-3 code "USA," and numeric code "840." The capital city of the United States is Washington, D.C. The country covers a total area of approximately 9,826,675 square kilometers.The population of the United States is around 331 million people. The citizens of the United States are referred to as Americans. The country's official currency is the United States Dollar (USD), which is denoted by the currency code "USD." The international dialing code for the United States is "1."In summary, the United States of America, with its capital in Washington, D.C., is a North American nation with a large population of around 331 million. It occupies a vast total area of approximately 9,826,675 square kilometers. The country is identified by the ISO-3166-1 codes US, USA, and 840, and it uses the United States Dollar (USD) as its official currency.

For more such question on codes
https://brainly.com/question/28338824

#SPJ8


What does it mean when your internet connection is shaped

Answers

Answer:

Some of your heavier internet usages will be shaped, meaning that you will experience slower connection when performing certain tasks like streaming movies or videos, updating your software, access your desktop remotely, or gaming

Accumulating Totals in Single- Level Control Break Programs Summary In this lab , you will use what you have learned about accumulating totals in a single - level control break program to complete a C++ program . The program should produce a report for a supermarket manager to help her keep track of the hours worked by her part- time employees . The report should include the day of the week and the total hours worked by all employees each day . The student file provided for this lab includes the necessary variable declarations and input and output statements . You need to implement the code that recognizes when a control break should occur . You also need to complete the control break code . Be sure to accumulate the daily totals for all days in the week . Comments in the code tell you where to write your code .

Instructions 1. Study the prewritten code to understand what has already been done . 2. Write the control break code , including the code for the dayChange () function , in the main (function . 3. Execute the program by clicking the Run button at the bottom of the screen . Use the following input values : Monday - 6 hours ( employee 1) Tuesday - 2 hours (employee 1 ), 3 hours ( employee 2) Wednesday - 5 hours (employee 1 ), 3 hours (employee 2 ) Thursday -6 hours (employee 1 ) Friday - 3 hours ( employee 1), 5 hours ( employee 2) Saturday - 7 hours (employee 1 ), 7 hours (employee 2) , 7 hours ( employee 3) Sunday hours

1 // SuperMarket. cpp - This program creates a report that lists weekly hours worked
2 // by employees of a supermarket. The report lists total hours for
3 // each day of one week
4 // Input:
Interactive
5 // Output: Report.
6
7 #include
8 #include
8 #include
8 #include dayOfWeek;
if (day0fWeek
== SENTINEL)
notDone = false;
else
{
cout <‹ "Enter hours worked: cin >> hoursWorked;
prevDay = dayOfWeek;
}
while(notDone == true)
// Implement control break logic here
// Include work done in the dayChange () function
cout <‹ "\t\t" << DAY_FOOTER <‹ hoursTotal <‹ endl;
return 0;

Answers

Based on the provided code snippet, it seems that the instructions and implementation details of a C++ program are missing. It appears to be an incomplete code snippet with placeholders for implementing control break logic and the dayChange() function.

To complete the program, you would need to carefully study the prewritten code, understand the requirements and control break conditions, and then write the missing parts as instructed. This includes implementing the control break logic and completing the dayChange() function.

Question 6 (1 point)
Janelle is creating a model of a bathroom in Blender. She is currently working on the
tile pattern for the walls of the shower. She has decided on a hexagonal shape
surrounded by four squares. Since this pattern will be repeated over the entire
shower wall, which of the following modifiers should she use to create enough
copies of it to populate the entire area?
Boolean
Bevel
Array
Screw

Answers

To create enough copies of the tile pattern to populate the entire area of the shower wall in Blender, Janelle should use the C) Array modifier.

The Array modifier in Blender allows for the creation of multiple copies or instances of an object, arranged in a specified pattern.

It is particularly useful when creating repetitive patterns, as in the case of the tile pattern for the shower walls.

By applying the Array modifier to the initial tile pattern, Janelle can define the number of copies to be made and the desired spacing or offset between them.

She can configure the modifier to create a grid-like arrangement of the tiles, allowing her to cover the entire area of the shower wall seamlessly.

The Array modifier offers flexibility in terms of adjusting the pattern's size, rotation, and other parameters to achieve the desired look.

Additionally, any changes made to the original tile will be automatically propagated to all the instances created by the modifier, streamlining the editing process.

While the other modifiers mentioned—Boolean, Bevel, and Screw—have their own specific uses, they are not suitable for creating multiple copies of a tile pattern.

The Boolean modifier is used for combining or cutting shapes, Bevel for adding rounded edges, and Screw for creating spiral or helix shapes.

For more questions on Array

https://brainly.com/question/29989214

#SPJ8

following the 2012 olympic games hosted in london. the uk trade and envestment department reported a 9.9 billion boost to the economy .although it is expensive to host the olympics,if done right ,they can provide real jobs and economic growth. this city should consider placing a big to host the olympics. expository writing ,descriptive writing, or persuasive writing or narrative writing

Answers

The given passage suggests a persuasive writing style.

What is persuasive Writing?

Persuasive writing is a form of writing that aims to convince or persuade the reader to adopt a particular viewpoint or take a specific action.

The given text aims to persuade the reader that the city being referred to should consider placing a bid to host the Olympics.

It presents a positive example of the economic benefits brought by the 2012 Olympic Games in London and emphasizes the potential for job creation and economic growth.

The overall tone and content of the text are geared towards convincing the reader to support the idea of hosting the Olympics.

Learn more about persuasive writing :

https://brainly.com/question/25726765

#SPJ1


Full Question:

Following the 2012 Olympic Games hosted in London, the UK Trade and Investment Department reported a 9.9 billion boost to the economy. Although it is expensive to host the Olympics, if done right, they can provide real jobs and economic growth. This city should consider placing a bid to host the Olympics.

What kind of writing style is used here?

A)  expository writing

B) descriptive writing

C)  persuasive writing

D)  narrative writing

create a questionnaire to gain information about one emerging technology of your choice. you could choose from several options, such as cloud computing, pervasive computing, wearable computing, artificial intelligence, and other technologies.

Answers

Sure! Let’s create a questionnaire to gain information about Artificial Intelligence (AI):

1. What is your familiarity with Artificial Intelligence (AI)?
a) Very familiar
b) Somewhat familiar
c) Not familiar at all
2. Have you personally used or interacted with any AI-powered technologies or applications?
a) Yes
b) No
3. Which of the following areas do you think AI has the most significant impact on? (Select all that apply)
a) Healthcare
b) Finance
c) Transportation
d) Education
e) Retail
f) Other (please specify)
4. In your opinion, what are the main advantages of AI technology? (Select all that apply)
a) Improved efficiency and productivity
b) Enhanced decision-making capabilities
c) Automation of repetitive tasks
d) Advanced data analysis and insights
e) Improved customer experience
f) Other (please specify)
5. Are you concerned about the ethical implications of AI technology? Why or why not?
6. How do you see AI impacting the job market and employment opportunities in the future?
7. What are your thoughts on the potential risks and challenges associated with AI implementation?
8. Have you encountered any AI applications or technologies that you believe need improvement or further development? If yes, please provide details.
9. Are you aware of any regulatory or legal frameworks in place to govern AI technology? If yes, please share your knowledge on this topic.
10. In your opinion, what are the key areas where AI technology should be further explored or expanded?
11. Are you personally excited about the future prospects and advancements of AI technology? Why or why not?
12. Would you be open to using AI-powered products or services in your personal or professional life? Why or why not?

After sending a business e-mail, how long should you generally wait before following up for a response? Select one.

Question 7 options:

It’s never good etiquette to follow up


End of business day


24 hours


48 hours

Answers

After sending a business email, we have to wait for : End of business day.

After sending a business email, it is generally considered appropriate to wait until the end of the business day before following up for a response. This allows the recipient sufficient time to review their emails and respond accordingly. By waiting until the end of the business day, you demonstrate patience and respect for the recipient's schedule and workload.It's important to note that the appropriate timeframe for following up may vary depending on the urgency and nature of the email. If the matter is time-sensitive or requires immediate attention, it may be appropriate to follow up sooner, such as within a few hours or by the next business day.It's worth considering any specific instructions or expectations provided by the recipient or your company's communication protocols. Some organizations may have defined response timeframes or guidelines for follow-ups that you should adhere to.It's essential to strike a balance between being proactive and respectful of the recipient's time and workload when deciding when to follow up on a business email.

The correct option is: End of business day.

For more such questions on business email

https://brainly.com/question/30129889

#SPJ8

1. A company that produces office organizers is currently utilizing 10 hours per day to complete 90 pcs of the product. Engr Ulymarl, the senior process engineer proposes to do minor change in the process flow to avoid redundancy. By doing this, the output increased to 110 pcs. The material cost per organizer is BD 5; additional supplies needed to complete the organizer cost BD 1.50 and labor is paid at the rate of BD 2.5 per hour, energy cost is assumed to be BD 1.5 while water cost is at BD 1.75. a. Is there any improvement in productivity with the changes that have been implemented by the process engineer? b. Prove your answer though presenting the labor productivity, multifactor productivity and productivity improvement. c. What is your conclusion on the action done by Engr Ulymarl ?

Answers

a. Yes, there is an improvement in productivity as the output increased from 90 to 110 pcs.

b. Labor Productivity: 11 pcs/hour. Multifactor Productivity: 0.88 pcs/(BD 11.75) per day. Productivity Improvement: 22.2% increase.

c. Engr Ulymarl's action improved productivity by increasing output per hour and overall efficiency, leading to positive results and potentially better profitability.

a. Yes, there is an improvement in productivity with the changes implemented by the process engineer. The output increased from 90 to 110 pcs, indicating higher productivity.

b. To prove the improvement in productivity, we can calculate the following metrics:

Labor Productivity: Divide the output (110 pcs) by the labor hours (10 hours) to obtain the labor productivity per hour .

         Labor Productivity = Output / Labor Hours

Multifactor Productivity: Sum up the costs of materials, additional supplies, labor, energy, and water, and divide the output (110 pcs) by the total cost to calculate the multifactor productivity.

        Multifactor Productivity = Output / (Material Cost + Additional Supplies.              

       Cost + Labor Cost + Energy Cost + Water Cost)

Productivity Improvement: Compare the initial and improved productivity measures to determine the percentage increase.

        Productivity Improvement = ((Improved Productivity - Initial        

        roductivity) / Initial Productivity) * 100

c. Engr Ulymarl's action resulted in a significant improvement in productivity. The increased output per hour of labor indicates higher efficiency. The labor productivity, multifactor productivity, and productivity improvement calculations would provide concrete evidence of the positive impact of the process flow changes. The proposed actions by Engr Ulymarl have successfully enhanced productivity, leading to better output and potentially higher profitability for the company.

For more such question on productivity

https://brainly.com/question/21044460

#SPJ8

Other Questions
The armature of a 8-pole separately excited dc generator is lap wound with 543 conductors. This machine delivers power to the load at 250V while being driven at 1100 rpm. At this load, the armature circuit dissipates 670W. If the flux per pole of this generator is 35-mWb, determine the kW rating of the load served.Assume a total brush contact drop of 2V. A solution composed of 54% ethanol (EtOH), 7% methanol (MeOH), and the balance water (H2O) is fed at the rate of 129 kg/hr into a separator that produces one stream at the rate of 50 kg/hr with the composition of 87% EtOH, 14% MeOH, and the balance H2O, and a second stream of unknown composition. Calculate the% of water in the unknown stream.in 2 decimal values A security architect is required to deploy to conference rooms some workstations that will allow sensitive data to be displayed on large screens. Due to the nature of the data, it cannot be stored in the conference rooms. The fileshares is located in a local data center. Which of the following should the security architect recommend to BEST meet the requirement?A.Fog computing and KVMsB.VDI and thin clientsC.Private cloud and DLPD.Full drive encryption and thick clients Which types of business structure can pay dividends to stockholders when there is a profit? for profit non profit public health all of the above. 1.Suppose we have a gas with a "dry" composition (that is the composition of the non-water portion of the gas), of 70% N2, 11%O2, 15%CO2 and 4% CO. Now suppose the gas is 18% water, with the dry portion of the composition above. What is the N2 %on a "wet" basis?2.Say we have an Ideal Gas flowing at 84.07 l/min. The pressure is 9.77 atm and the temperature is 28.57 C. What is the molar flowrate in mol/min? A converter works with input voltage of 220V, 60Hz. The load has an R=12ohm and an inductance of 45mH. The output voltage frequency is 20Hz and the firing angle is 135. Calculate:a) the output/input frequency ratiob) the rms output voltagec) the power dissipated in the load A three-phase Y-connected synchronous motor with a line to line voltage of 440V and a synchronous speed of 900rpm operates with a power of 9kW and a lagging power factor of 0.8. The synchronous reactance per phase is 10 ohms. The machine is operating with a rotor current of 5A. It is desired to continue carrying the same load but to provide 5kVAR of power factor correction to the line. Determine the required rotor current to do this. Use two decimal places. A quarter wavelength line is to be used to match a 36 load to a source with an output impedance of 100. Calculate the characteristic impedance of the transmission line. Macduffs reaction to the news of what has happened to his wife and children shows him to be Happy and cheerful Weak and bumbling Sensitive and caringCold and calculating A generator is rated 100 MW, 13.8 kV and 90% power factor. The effective resistance is 1.5 times the ohmic resistance. The ohmic resistance is obtained by connecting two terminals to a dc source. The current and voltage are 87.6 A and 6 V. Find the effective resistance per phase what do demographic studies analyze You will select 2 of the 5 ideas in your Ideas Log to "test" through a research process. Your summary will involve a preliminary market overview of these entrepreneurial solutions, exploring: iCustomers, iCompetitors, i Product/service, i Suppliers, i Business location, and i Industry. Your summary should include research under the subheadings: i) Demographics and segmentation, ii) Target market, iii) Market need, iv) Competition, v) Barriers to entry, and vi) Regulation. In this assessment, a preliminary market overview must include key business aspects under each of the suggested subheadings. Your writing is expected to be clear and well-evidenced with reliable sources. Overall, you will be assessed on how critically you: i Identify and evaluate business ideas, i Consider resourcing for business ideas, i Identify and discuss ethical issues, and social or business responsibility issues, and i Describe how potential investors and team members might be sourced. Without using the function EXP, write a function in SCL for calculation of the natural number e = 2.7182818 .The basis for the calculations is the series:1111e = 1+1+1+2+1:2:3+1.2.3.4+......The series is to close when the next member in the series is less than 1.0 106 .The function should be a "non-void function". The function delivers the value to the calling program via its name: dbTestfc.rExp2 := fcExpo();Make the SCL code with explainations. a.Create a CeaserCipher class to perform substitution and reverse substitution of characters of a message.mEncryption method substitute a character with another character of alphabet.mDecryption method similar to mEncryption method but it performs in reverse.Each character of message is considered as numeric value with the following mapping:a-z to 0-25, respectively.The mEncryption method replaces each character of the message with another character by using the following formula:(N(ch)+k)%26, where N(ch) means Numeric value of a character 'ch', k means key value 0 3. (15%) Let T be a pointer that points to the root of a binary tree. For any node a in the tree, the skewness of x is defined as the absolute difference between the heights of r's left and right sub-trees. Give an algorithm MostSkewed (T) that returns the node in tree T that has the largest skewness. If there are multiple nodes in the tree with the largest skewness, your algorithm needs to return only one of them. You may assume that the tree is non-null. As an example, for the tree shown in Figure 1, the root node A is the most skewed with a skewness of 3. The skewness of nodes C and F are 1 and 2, respectively. How does mental complexity affect ethical decision making?identifying the moral strengths and weaknesses of at least twoorders of mental complexity. A mass is suspended from a string and moves with a constant upward velocity. Which statement is true concerning the tension in the string?a. The tension is equal to the weight of the mass.b. The tension is less than the weight of the massc. The tension is equal to zero.d. The tension is greater than the weight of the masse. The tension is equal to the mass For the circuit in Figure 1, iz(0) = 2A, vc (0) = 5V a. Compute v(t) for t>0. R il (1) v(t) 150 10 H is = 20 sin (6400t + 90)uo(t) A 1s ict 1/640 F Task 2Activation Polarization is a mechanism that explains thecorrosion rate. Explain which part of the reaction determines thetotal reaction rate. find the equation of the line tangent to the graph y=(x^2/4)+1,at point (-2,2)