Use the web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a program that prompts a user for a month, day, and year, and then displays a message specifying whether the entered day is in the past, is today (the current date), or is in the future.
import java.util.*;
import java.time.LocalDate;
public class PastPresentFuture2
{
public static void main(String args[])
{
int mo,da,yr;
LocalDate today=LocalDate.now();
System.out.println("Program to find if the given date is in past, present or future::");
Scanner input=new Scanner(System.in);
//taking inputs from console and storing them in three variables.
System.out.print("Enter month::");
mo=input.nextInt();
System.out.print("Enter day::");
da=input.nextInt();
System.out.print("Enter year::");
yr=input.nextInt();
//creating a LocalDate object and initializing it to null;
LocalDate inputDate=null;
try
{
/*we are using the 3 variables and converting it into a date object to compare it with today's date */
inputDate = LocalDate.of(yr,mo,da);
}
catch(Exception ex)
{
/*if the entered day,month & year are not converted to a date object because of invalid entry of any values, we are stopping the program.*/
System.out.println("You have made invalid entries, please try again !!");
System.exit(0);
}
/*if the date object is created after proper entries, we are using the built-in functions to compare it the today's date object*/
System.out.print("The date you entered is ");
if(inputDate.isBefore(today))
System.out.println("in the past.");
else
if(inputDate.isAfter(today))
System.out.println("in the future.");
else
if(inputDate.equals(today))
System.out.println("the current date.");
}
}

Answers

Answer 1

Answer:

Explanation:

The code provided is already taking in the input and comparing it to the current date using the methods isBefore(), isAfter(), and equals(). It works perfectly and did not need any changes to the code. As you can see from the attached pictures below, every scenario works as intended. If the format is not correct and the date object is not able to be created then it prompts an error message and exits the program as intended.

import java.util.*;

import java.time.LocalDate;

class PastPresentFuture2

{

   public static void main(String args[])

   {

       int mo,da,yr;

       LocalDate today=LocalDate.now();

       System.out.println("Program to find if the given date is in past, present or future::");

       Scanner input=new Scanner(System.in);

//taking inputs from console and storing them in three variables.

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

       mo=input.nextInt();

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

       da=input.nextInt();

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

       yr=input.nextInt();

//creating a LocalDate object and initializing it to null;

       LocalDate inputDate=null;

       try

       {

           /*we are using the 3 variables and converting it into a date object to compare it with today's date */

           inputDate = LocalDate.of(yr,mo,da);

       }

       catch(Exception ex)

       {

           /*if the entered day,month & year are not converted to a date object because of invalid entry of any values, we are stopping the program.*/

           System.out.println("You have made invalid entries, please try again !!");

           System.exit(0);

       }

       /*if the date object is created after proper entries, we are using the built-in functions to compare it the today's date object*/

       System.out.print("The date you entered is ");

       if(inputDate.isBefore(today))

           System.out.println("in the past.");

       else

       if(inputDate.isAfter(today))

           System.out.println("in the future.");

       else

       if(inputDate.equals(today))

           System.out.println("the current date.");

   }

}

Use The Web To Learn How To Use The LocalDate Boolean Methods IsBefore(), IsAfter(), And Equals(). Use
Use The Web To Learn How To Use The LocalDate Boolean Methods IsBefore(), IsAfter(), And Equals(). Use
Use The Web To Learn How To Use The LocalDate Boolean Methods IsBefore(), IsAfter(), And Equals(). Use

Related Questions

what are the different cpu sockets?

Answers

Answer:

Intel Is Somethings mainley LGA 1151, 1155, 1125 Etc.

On the other hand there are AMD sockets mainley in past gens there are am2 am3 now its am4 and so on hope this helped!

Explanation:

David Karp is credited with the invention of which microblogging service?

Answers

Answer:

On February 19, 2007, the first version of the Tumblr microblogging service was founded by David Karp and Marco Arment. They launched a more complete version in April 2007.

Explanation:

More than 100 million blogs will be online in 2007. The count continues to double every 5.5 months. About half of the blogs created are ever maintained after being created. And fewer than 15% of blogs are updated at least once a week. (Technorati)

….Yeah, it’s still a blog. But it’s a new philosophy. It’s free of noise, requirements, and commitments. And it’s finally here.

let me know if that is good enough

Which of the following pieces of evidence was NOT used to support the Theory of Continental Drift?

A.The shape of the continents appears to fit together like a puzzle.
B.Identical fossils have been found on multiple continents separated by oceans.
C.Similar landforms are continuous between two continents when matched up.
D.There were traces of land bridges connecting separate continents.
There were traces of land bridges connecting separate continents.

Answers

I think that the answer is D pretty sure

The pieces of evidence that is not used as support is that There were traces of land bridges connecting separate continents.

How did the continents separate and drift apart?

The rotation of the Earth is known to be the reason for the continents to move towards and also apart from each other. .

Therefore, The pieces of evidence that is not used as support is that there were traces of land bridges connecting separate continents.

Learn more about Continental Drift from

https://brainly.com/question/394265

#SPJ6

what is file system manipulation​

Answers

Answer:

Program requires to read a file or write a file. Operating system gives the permission to the program for operation on file. ... The Operating System provides an interface to the user to create/delete files and directories. The Operating System provides an interface to create the backup of file system.

What are possible penalties if a designer is caught breaking copyright laws?

Select all that apply.


removing the design from internet
having a work computer confiscated
losing access to software programs
paying fines to copyright owner

Answers

Answer:

1 and 4 are the correct answers.

Explanation:

1
Q9. Which tool is used to cancel the
action of undo tool ? *

Answers

Answer:

hold down CTRL + Z and it will reverse to the last action

please help me :)
Consider the program segment below. Assume k is a positive number.

for (int i = 2; i <= k; i++)
if (nums[i] < someValue)
System.out.println("FOUND");
What is the maximum number of times FOUND can be printed?

Group of answer choices

k - 1

1

0

k

k - 2

Answers

Answer:

k - 1 times

Explanation:

Given

The attached code snipped

Required

Maximum number of times, the print statement is executed

From the iteration, we have: i = 2; i<=k; i++

This means that; i = 2 to k

Say: [tex]k = 5[/tex]

[tex]i = 2, 3,4,5[/tex] (4 values) i.e. 5 - 1

Say [tex]k = 10[/tex]

[tex]i = 2,3,4,5,6,7,8,9,10[/tex] (9 values) i.e. 10 - 1

So, the maximum number of times is k - 1

After Sally adds the Print Preview and Print command to the Quick Access Toolbar, which icon would she have added? the icon that shows an open folder the icon that shows a sheet of paper the icon that shows a printer with a check the icon that shows a sheet of paper and a magnifying glass

Answers

Answer: the icon that shows a sheet of paper and a magnifying glass

Explanation:

The Quick Access Toolbar, gives access to the features that are usually used like Save, Undo/Redo. It can also be customized such that the commands that the users usually use can be placed quicker and therefore makes them easier to use.

After Sally adds the Print Preview and Print command to the Quick Access Toolbar, the icon that she would have added is the icon that shows a sheet of paper and a magnifying glass.

Answer:

d

Explanation:

A method signature for a method consists of all elements of the method except the body. That is, a method signature consists of the privacy, (non-)static, return datatype, method name, and formal parameters. Consider the ceiling method as an example.
public static int ceiling (double num)
{
return num <= 0 ? (int) num: (int) num + 1;
}
The method signature of the ceiling method is the first line of the method: public static int ceiling (double num). In this example, we note that ceiling is static because it is a standalone method and does not require an object to invoke (since we are not acting on an instance of a class).
For parts a - d, give the method signature described by the scenario.
a) A method in class String that returns the reversed version of the current String.
b) A method that returns the maximum of two given integers.
c) A method that returns true or false if the input integer is an even number.
d) A default constructor for class Table.

Answers

To be honest I feel like it’s B that’s looks and seems the most correct to me

To view a friend's calendar, you must request access.
A) True
B) False

Answers

Answer:

True the answer is true

Explanation:

I hope this helps

Answer:

True?

Explanation:

You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The ISP has installed a connection to both RJ45 jacks on the wall plate. You are responsible for selecting the correct router to connect the network to the internet. You want to use the fastest connection speed available while providing for security for both the Home-PC and Home-PC2 computers.

Your task is to complete the following:

⢠Use the appropriate network components to connect the two computers to the new ISP.
⢠Place the Ethernet router with firewall capabilities on the Workspace.
⢠Use the existing Cat5e Ethernet cables to connect the computers to the router's integrated Ethernet LAN ports.
⢠Use the AC to DC power adapter to plug in the device.
⢠Use the Network and Sharing Center on both computers to confirm that the computers are properly connected to the network and internet.

Answers

Home pc1 becouse it is the right one

what The computer needs both
and
to
function properly?​

Answers

Answer:

It needs power in order to function

Explanation:

What steps can be used to password-protect a worksheet?

1. Click the
tab.

2. Go to the
group.

3. Click
. Type a password and click OK.

4. Reenter the password and click OK.

Answers

Answer:

Review

Changes

Protect sheet

Explanation:

I did it

Calculate The Average of Grades Instructions:
Please read the following problem carefully. You will then logon on to https://www.draw.io/to create a professional diagram. You will put all titles, labels, and save your work using the information below. Please follow the directions:
Destini would like to get a better understanding of her grades in all of her college courses before Spring Break. Instead of using a calculator and paper to calculate her grade, she decided to design a program. She will design a program that will ask her to enter her course name and the number of grades in her grade book. The program will then Read the number of Grades based on what was entered by her, Add up all the Grades, Calculate the Average, and Display Course Name and the Average to Screen. It is important to consider that the number of grades will be different for each course. Using Repetition Control, please design this program.
1. Please Create Flowchart using Draw.10 and Simple Flowchart symbols only (Draw.IO)
2. Pseudocode.
Your unique Flowchart must have the following (See Example Here):
A. Name, Date, and class Name [Top Left of Flowchart)
B. A Title of the Flowchart in Bold [Centered at the top of your flowchart)
C. A Brief Summary of your Flowchart (2 to 3 short sentences describing your flowchart) [Left of Flowchart]

Answers

Answer:

The pseudocode is as follows:

Input coursename, numgrades

count = 1; totalgrades = 0

while count <= numgrades:

   input grade

   totalgrade+=grade

   count++

average = totalgrade/count

print(coursename)

print(average)

Explanation:

The solution is as follows:

(1) See attachment for flowchart

(2) See answer section for pseudocode

Explanation

Input coursename and number of grades

Input coursename, numgrades

Initialize count of grades input by the user to 1 and the sum of all grades to 0

count = 1; totalgrades = 0

This loop is repeated while count of grades input by the user is less than or equal to the numgrades

while count <= numgrades:

Input grade

   input grade

Add grades

   totalgrade+=grade

Increase count by 1

   count++

End of loop

Calculate average

average = totalgrade/count

Print coursename

print(coursename)

Print average

print(average)

C. Summary of the flowchart

The flowchart gets coursename and the number of grades from the user. Then it gets the score of each grade, add them up t calculate the average of grades.

Lastly, the course name and the average grades is printed

In 5-6 sentences explain how technology has impacted engineers.

Answers

Answer:

gissa vem som är tillbaka, tillbaka igen

Explanation:

translate it pls

Sketch a 3-view orthographic projection of the object shown

Answers

Answer:

Explanation:

/|_/]

how to make windiws 10 to wundows 21?​

Answers

Answer:

You multiply it.

draw
b. When you start Microsoft Word, a blank document
appears with the name Document1 in the title bar. is it true or false​

Answers

Answer:

it is true,a blank document appears with the name Document 1

Select the device that will have the most network ports

1. Switch
2. Server
3. Laptop
4. Desktop

Answers

Answer:

desktop

Explanation:

Summary
In this lab, you use what you have learned about searching an array to find an exact match to complete a partially prewritten C++ program. The program uses an array that contains valid names for 10 cities in Michigan. You ask the user to enter a city name; your program then searches the array for that city name. If it is not found, the program should print a message that informs the user the city name is not found in the list of valid cities in Michigan.
The file provided for this lab includes the input statements and the necessary variable declarations. You need to use a loop to examine all the items in the array and test for a match. You also need to set a flag if there is a match and then test the flag variable to determine if you should print the the Not a city in Michigan.message. Comments in the code tell you where to write your statements. You can use the previous Mail Order program as a guide.
Instructions
Ensure the provided code file named MichiganCities.cppis open.
Study the prewritten code to make sure you understand it.
Write a loop statement that examines the names of cities stored in the array.
Write code that tests for a match.
Write code that, when appropriate, prints the message Not a city in Michigan..
Execute the program by clicking the Run button at the bottom of the screen. Use the following as input:
Chicago
Brooklyn
Watervliet
Acme
// MichiganCities.cpp - This program prints a message for invalid cities in Michigan.
// Input: Interactive
// Output: Error message or nothing
#include
#include
using namespace std;
int main()
{
// Declare variables
string inCity; // name of city to look up in array
const int NUM_CITIES = 10;
// Initialized array of cities
string citiesInMichigan[] = {"Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"};
bool foundIt = false; // Flag variable
int x; // Loop control variable
// Get user input
cout << "Enter name of city: ";
cin >> inCity;
// Write your loop here
// Write your test statement here to see if there is
// a match. Set the flag to true if city is found.
// Test to see if city was not found to determine if
// "Not a city in Michigan" message should be printed.
return 0;
} // End of main()

Answers

Answer:

Replace the comments with:

for(x = 0; x < NUM_CITIES; x++){

      if(inCity == citiesInMichigan[x]){           foundIt = true;}

  }

  if(foundIt){ cout<<"Exists";}

  else{cout<<"Does not exists";}  

 

Explanation:

This iterates through the cities

[tex]for(x = 0; x < NUM\_CITIES; x++)\{[/tex]

This checks if current city in the array matches the city input by the user

[tex]if(inCity == citie sIn Michigan[x])\{[/tex]           foundIt = true; If yes, foundIt is set to true}

  }

If foundIt is true, print "Exists"

if(foundIt){ cout<<"Exists";}

If foundIt is false, print "Does not Exists"

  else{cout<<"Does not exists";}  

See attachment for complete program

Which two of the following are conditions of AI programming that enable robots to either accept or reject commands from humans?
Group of answer choices

equality principle

knowledge

semantic manipulation

enhanced circuitry

capacity

Answers

knowledge and capacity

hope this helps :)

What is a typical use for a MAN?

A.
to connect devices in five offices adjacent to each other
B.
to connect computers across a university campus
C.
to connect corporate offices across three continents
D.
to connect the computers in a private library

Answers

A.to connect devices in five offices adjacent to each other

Answer:

B. to connect computers across a university campus

Explanation:

Plato correct!

Think of—and explain—one or more ways that society could use big data

Answers

Answer:

Naumann noted there are many positive ways to use big data, including weather prediction, forecasting natural disasters, urban and community planning, traffic management, logistics and machine efficiency, personalized healthcare, customized learning, autonomous vehicles, fraud detention, robotics, translation, smart ...

A police department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so that it can be determined very quickly whether or not a given license plate is in the database. Speed of response is very important; efficient use of memory is also important, but not as important as speed of response. Which of the following data structures would be most appropriate for this task?

a. a sorted linked list
b. a sorted array with 1,800 entries
c. a hash table using open addressing with 1,800 entries
d. a hash table using open addressing with 3,600 entries
e. a hash table using open addressing with 10,000 entries

Answers

Answer:

c.

Explanation:

I believe that in this scenario, the best option for this data would be a hash table using open addressing with 1,800 entries. Hash tables consume more memory than lists but it makes up for it with much faster response time speeds. This is because hash tables work on a key:value system therefore, the license plate can easily be grabbed from the database extremely quickly by just plugging in the plate number. Doing so will retrieve all of the saved information from that license plate. That is why hash tables have a constant time complexity of O(1)

The data structures that would be most appropriate for this task is; D: a hash table using open addressing with 3,600 entries

What is the Importance of Hash Tables?

A hash table is also called a hash map and is defined as a data structure that implements an associative array abstract data type which is basically a structure that can map keys to values.

A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets onto a platform that the desired value can be found.

From the above definitions of a hash function and looking at the question, we can say that the data structure that would be most appropriate for the given task is a hash table using open addressing with 3,600 entries.

Read more about hash table at; https://brainly.com/question/4478090

Internal memory is synonymous with which memory

Answers

Answer:

Main Memory (RAM)

Explanation:

This is the memory which is directly accessible to the CPU. It can be called Main Memory, Prime Memory or simply 'Memory'

Answer:

the answer is Main Memory

Explanation:

Match each term in the second column with its correct definition in the first column. Write the letter of the term on the blank line in front of the correct definition. A chart that shows the relationship of each part to a whole. A what-if analysis tool that find the input needed in one cell to arrive at the desired result in another cell. In a formula, the address of a cell based on the relative position of the cell that contains the formula and the cell referred to in the formula. A column, bar, area, dot, pie slice, or other symbol in a chart that represents a single data point. A workbook sheet that contains only a chart. A shape effect that uses shading and shadows to make the edges of a shape appear to be curved or angled. The entire chart and all of its elements. The process of changing the values in cells to see how those changes affect the outcome of formulas in a worksheet. The mathematical formula to calculate a rate of increase. The mathematical rules for performing multiple calculations within a formula. The Excel feature which, after typing - and the first letter of a function, displays a list of function names. A line that serves as a frame of reference for measurement and that borders the chart plot area. The area along the bottom of a chart that identifies the categories of data; also referred to as the x-axis. A numerical scale on the left side of a chart that shows the range of numbers for the data points; also referred to as the y-axis. The formula for calculating the value after an increase by multiplying the original value the base by the percent for new value.

Answers

Answer:

1. Pie chart.

2. Goal seek.

3. Relative reference cell.

4. Data marker.

5. Chart sheet.

6. What-If-Analysis.

7. [tex] Rate = \frac {Amount \; of \; increase}{Base} [/tex]

8. Order of operations.

9. Formula AutoComplete.

10. Axis.

11. Category axis.

12. Value axis

13. [tex] Value \; after \; increase = Base * Percent \; for \; new \; value [/tex]

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

Some of the terminologies and features of the Microsoft Excel software includes the following;

1. Pie chart: a chart that shows the relationship of each part to a whole.

2. Goal seek: a what-if-analysis tool that finds the input needed in one cell to arrive at the desired result in another cell.

3. Relative reference cell: in a formula, the address of a cell based on the relative position of the cell that contains the formula and the cell referred to in the formula.

4. Data marker: a column, bar, area, dot, pie slice, or other symbol in a chart that represents a single data point.

5. Chart sheet: a workbook sheet that contains only a chart.

6. What-If-Analysis: the process of changing the values in cells to see how those changes affect the outcome of formulas in a worksheet.

7. [tex] Rate = \frac {Amount \; of \; increase}{Base} [/tex]: The mathematical formula to calculate a rate of increase.

8. Order of operations: the mathematical rules for performing multiple calculations within a formula.

9. Formula AutoComplete: the excel feature which, after typing - and the first letter of a function, displays a list of function names.

10. Axis: a line that serves as a frame of reference for measurement and that borders the chart plot area.

11. Category axis: the area along the bottom of a chart the identifies the categories of data, also referred to as the x-axis.

12. Value axis: a numerical scale on the left side of a chart that shows the range of numbers for the data points, also referred to as the y-axis.

13. [tex] Value \; after \; increase = Base * Percent \; for \; new \; value [/tex]: the formula for calculating the value after an increase by multiplying the original value the base by the percent for new value.

A sql-6-5.sql file has been opened for you. Write each of the following tasks as a SQL statement in a new line (remember that you can source the file to compare the output reference): Use the e_store database Select the total stock of all products in the products table. Alias the column name as total_stock. The resulting table should look like this:

Answers

Answer:

The query is as follows:

select sum(stock) as total_stock from products

Explanation:

Required

Return total stock using the alias total_stock from the product table.

The explanation of the query is as follows:

select ----> This implies that data is to be selected from the table

sum(stock) ----> This adds up entries in stock column

as total_stock ---> This represents the alias used for sum(stock)column where

from products  ----> The table being queried

Take for instance, the content of the table is:

SN  Product Stock

1      Apple     5

2     Orange   3

3      Banana   8

The query will return the following table:

total_stock

16

You have a project that requires you to work in a team setting. You know of a developer who has the credentials you
need, works well in a team, and does not need supervision to get the job done. The problem is that the developer is not
within your geographic location. One solution is to allow the developer to blank
full-time.

Answers

Answer:

work remotely

Explanation:

The best solution would be to allow the developer to work remotely full-time. This means that they would be working from home all the time and would most likely communicate with the rest of the team via other means. Usually, unimportant communication would be done through e-mail while important issues and team meetings would be done through video conference. This will allow you to hire this developer and add him/her to the team without having to worry about any issues arising due to transportation.

A program spends 30% of its time performing I/O operations, 25% of its time doing encryptions, and the remaining 45% of its time doing general computations. The user is considering purchasing one of three possible enhancements, all of which are of equal cost: (a) a new I/O module which will speed up I/O operations by a factor of 2, (b) adding encryption hardware which will cut the encryption time by 70%, and (c) a faster processor which will reduce the processing time for both general computations and encryptions by 40%. Which of these three enhancements will provide the best speedup? Hint: This is an application of Amdahl’s Law.

Answers

Answer:

a

Explanation:

Software that is downloaded from the internet fits into four categories what are they

Answers

Answer:

Application Software

Driver Software.

System Software

Programming Software

Answer:

application, system,driver and programming software

Other Questions
Matthew walks Ask Your Teacher mile to Zack's house. Which fraction is equivalent to Ask Your Teacher? a first number plus twice a second number is 8 twice the first number plus the second totals 25 Chronological and problem-solution Bill is renovating this house.Bill measures the length of the front of the house.The length is most likely to1.440 mO14,40 m14.40 mm144.0 m1440 mmScroll to read more What is the formula for the volume of a prism?What is the formula for the volume of a prism? Granny needs to paint a Loge made using two right triangles the dimensions Of the loge are shown below what is the difference between the area of the large triangle in the area of a small triangle plz help me on this question 2) What is the mass of a sample that produces -1,500 J if the specific heat is 1.0 and the temperature decreases by 30?3) What is the specific heat (C) of silver if we heat a 16g cube from 45 oC to 80 oC and it absorbs 41.3 J of thermal energy? Which of the following statements about the 2018 election are accurate? if 4.5kg sugar cost R36 what will 2.5kg cost Which is NOT a benefit of xenophyophores in a habitat?1 They maintain benthic biodiversity.2 They increase populations of isopods, mollusks, and crustaceans.3 They churn up sediments that build up on the ocean floor.4 They convert salt and iron into energy and nutrients. What was the Apollo 13 mission? A.to help Neil Armstrong and Buzz Aldrin return to Earth.B.to fix something that was in trouble in space.C.to land humans on the moon for the third time. A stationary hockey puck has a mass of 0.27 kg. A hockey player uses her stick to apply a 18 N force over a distance of 0.42 m. How much work does this force do on the puck?Group of answer choices7.6 J-43 J-7.6 J28 J43 J HELP NEEDED ASAP HELP ME PLZ i need Hyperbole: An extreme exaggeration. poem could be anythingmake a poem Species or systems that affect how each other develop over time are undergoing Bramble Corporation produces snowboards. The following per unit cost information is available: direct materials $10, direct labor $4, variable manufacturing overhead $6, fixed manufacturing overhead $13, variable selling and administrative expenses $5, and fixed selling and administrative expenses $13. Using a 40% markup percentage on total per unit cost, compute the target selling price. Wellington Corp. has outstanding accounts receivable totaling $6.5 million as of December 31 and sales on credit during the year of $24 million. There is also a credit balance of $12,000 in the allowance for doubtful accounts. If the company estimates that 6% of its outstanding receivables will be uncollectible, what will be the amount of bad debt expense recognized for the year Awnsers for 10, 11 and 12! What action did Harry Truman think would lead to the best chance for lasting peace after World War II?make defeated nations colonies of the United States and rebuild their economieskeep defeated nations in ruins so they have no chance to rebuild their economieshelp war-torn nations rebuild with sound economies and democratic governmentsallow war-torn nations to take care of themselves, with communist governments