You will write code to manipulate strings using pointers but without using the string handling functions in string.h. Do not include string.h in your code. You will not get any points unless you use pointers throughout both parts.
You will read in two strings from a file cp4in_1.txt at a time (there will be 2n strings, and you will read them until EOF) and then do the following. You alternately take characters from the two strings and string them together and create a new string which you will store in a new string variable. You may assume that each string is no more than 20 characters long (not including the null terminator), but can be far less. You must use pointers. You may store each string in an array, but are not allowed to treat the string as a character array in the sense that you may not have statements like c[i] = a[i], but rather *c *a is allowed. You will not get any points unless you use pointers.
Example:
Input file output file
ABCDE APBQCRDSETFG
PQRSTFG arrow abcdefghijklmnopgrstuvwxyz
acegikmoqsuwyz
bdfhjlnprtvx

Answers

Answer 1

Solution :

#include [tex]$< \text{stdio.h} >$[/tex]

#include [tex]$< \text{stdlib.h} >$[/tex]

int [tex]$\text{main}()$[/tex]

{

[tex]$\text{FILE}$[/tex] *fp;

[tex]$\text{fp}$[/tex]=fopen("cp4in_1.txt","r");

char ch;

//while(1)

//{

while(!feof(fp))

{

char *[tex]$\text{s1}$[/tex],*[tex]$\text{s2}$[/tex],*[tex]$\text{s3}$[/tex];

[tex]$\text{s1}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{s2}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{s3}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$40$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{int i}$[/tex]=0,j=0,x,y;

while(1)

{

ch=getc(fp);

if(ch=='\n')

break;

*(s1+i)=ch;

i++;

}

while(1)

{

ch=getc(fp);

if(ch=='\n')

break;

*(s2+j)=ch;

j++;

}

for(x=0;x<i;x++)

{

*(s3+x)=*(s1+x);

}

for(y=0;y<j;x++,y++)

{

*(s3+x)=*(s2+y);

}

for(x=0;x<i+j;x++)

{

printf("%c",*(s3+x));

}

printf("\n");

getc(fp);

}

}


Related Questions

Parts of a computer software

Answers

Answer:

I think application software

utility software

networking software

Which of the following is true about media production? A. All media elements contain a certain type of editorial viewpoint. B. Producing a media text involves both print and images C. Every type of media has a different set of tools and devices available. D. Media producers are all trying to confuse their audience

Answers

Answer:

C

Explanation:

Every form of media has different resources.

Which of the following is a form of media?Check all that apply.

A. a brochure distributed to many people

B. a diary

C. an email to a friend

D. a blog

Answers

Answer:

A. a brochure distributed to many people.

D. a blog.

Explanation:

Communication can be defined as a process which typically involves the transfer of information from one person (sender) to another (recipient), through the use of semiotics, symbols and signs that are mutually understood by both parties.

Generally, the linear model of communication comprises of four (4) main components and these are;

1. Sender (S): this is typically the source of information (message) or the originator of a message that is being sent to a receiver. Thus, they are simply the producer of a message.

2. Channel (C): this is the medium used by the sender for the dissemination or transmission of the message to the recipient. For example, telephone, television, radio, newspapers, billboards etc.

3. Message (M): this is the information or data that is being sent to a recipient by a sender. It could be in the form of a video, audio, text message etc.

4. Receiver (R): this is typically the destination of information (message) or the recipient of a message that is being sent from a sender.

Hence, the following are forms of media (communication channel);

I. A brochure distributed to many people. It comprises of printed textual informations used mainly for promotional purposes.

II. A blog. It is an online website that contains both textual and multimedia messages, especially as a news platform.

To have a reason or purpose to do something

a
Motivate
b
Identity
c
Deceive
d
Anonymous

Answers

The answer is A. Motivate

Answer:

A

Explanation:

pls explain the meaning of the word"INTERNET"​

Answers

electronic communications network
: an electronic communications network that connects computer networks and organizational computer facilities around the world —used with the except when being used attributively doing research on the Internetan Internet search

Answer:

i would say its a stream of network in which many people use

Explanation:

Declare a 4 x 5 array called N.

Using for loops, build a 2D array that is 4 x 5. The array should have the following values in each row and column as shown in the output below:

1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

Write a subprogram called printlt to print the values in N. This subprogram should take one parameter, an array, and print the values in the format shown in the output above.

Call the subprogram to print the current values in the array (pass the array N in the function call).

Use another set of for loops to replace the current values in array N so that they reflect the new output below. Call the subprogram again to print the current values in the array, again passing the array in the function call.

1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4

I really need help with this thanks. (In Python)

Answers

Answer:

N = [1,1,1,1,1],

[2,2,2,2,2],

[3,3,3,3,3],

[4,4,4,4,4]

def printIt(ar):

  for row in range(len(ar)):

      for col in range(len(ar[0])):

          print(ar[row][col], end=" ")

      print("")

           

N=[]

for r in range(4):

  N.append([])

   

for r in range(len(N)):

  value=1

  for c in range(5):

      N[r].append(value)

      value=value + 1

           

printIt(N)

print("")

newValue=1

for r in range (len(N)):

  for c in range(len(N[0])):

      N[r][c] = newValue

  newValue = newValue + 1

       

printIt(N)

Explanation:

:D

Below is the required program of Python.

Python

Program:

# Array name will be "N".

# Start program

# Defining a function and taking input array

def printIt(ar):

# Using for loop to scan the rows as well as columns of array

 for row in range(len(ar)):

     for col in range(len(ar[0])):

# Printing the element of array

         print(ar[row][col], end=" ")

     print("")

# Passing the array N

N=[]

# Again using the loop

for r in range(4):

 N.append([])

# Loop to control rows

for r in range(len(N)):

 value=1

# Loop to control columns

 for c in range(5):

     N[r].append(value)

     value=value + 1

# Calling the function

printIt(N)

print("")

newValue=1

# Value in row and column

for r in range (len(N)):

 for c in range(len(N[0])):

# Assigning the values to the array

     N[r][c] = newValue

 newValue = newValue + 1

# Printing the array

# End program

printIt(N)

Program code:

Start a program.Defining a function and taking input arrayUsing for loop to scan the rows as well as columns of arrayPrinting the element of arrayAgain using the loop to control rows and columns.Assigning the values to the arrayEnd program.

Output:

Find below the attachment of the output of the program code.

Find out more information about Python here:

https://brainly.com/question/26497128

What is a computer system model and explain?

Answers

Answer:

Systems modeling or system modeling is the interdisciplinary study of the use of models to conceptualize and construct systems in business and IT development. A common type of systems modeling is function modeling, with specific techniques such as the Functional Flow Block Diagram and IDEF0.

Explanation:

have a great day

A system performance assessment that is being utilized to forecast environmental circumstances, is a system model. A further explanation is provided below.

Manufacturers or consumers build including using theoretical model scheduling for construction project system stability, project capability, bottlenecks analysis as well as control systems configuration. This lecture is about the development of system models with an existing process or operational model.

Learn more about the Computer system model here:

https://brainly.com/question/20292974

According to O*NET, what is the most common level of education earned by Secondary School Special Education Teachers?

master’s degree
bachelor’s degree <------- THE ANSWER
some college, no degree
associate degree
POSTED TO HELP OTHERS

Answers

Answer:

bachelor’s degree

Explanation:

Answer:

B bachelors degree

Explanation:

Which of the following are complete sets of data and are the rows of the table?
Files
Fields
Queries
Records

Answers

Answer:

I think the answer is going to be records

Which of the following applications is most likely to benefit from the use of crowdsourcing?
a. An application that allows users to purchase tickets for a local museum
b. An application that allows users to convert measurement units (e.g., inches to centimeters, ounces to liters)
c. An application that allows users to view descriptions and photographs of local landmarks
d. An application that allows users to compress the pictures on their devices to optimize storage space

Answers

Answer:

C

Explanation:

Various companies crowdsource programs in order to have image libraries available to do certain tasks, one of those could be to see the landmark over time from different photos.

Q.No.3 b. (Marks 3)
Explain why change is inevitable in complex systems and give examples (apart from prototyping and incremental delivery) of software process activities that help predict changes and make the software being developed more resilient to change.

Answers

Answer:

The change in complex systems can be explained according to the relationship of the environment where the system is implemented.

The system environment is dynamic, which consequently leads to adaptation to the system, which generates new requirements inherent to changes in business objectives and policies. Therefore, changing systems is necessary for tuning and usefulness so that the system correctly supports business requirements.

An example is the registration of the justification of the requirements, which is a process activity that supports changes in the system so that the reason for including a requirement is understood, which helps in future changes

Explanation:

Which of the following enables robots to do things such as understand itself, walk, talk, and develop skills?
Group of answer choices

self-modeling

gigabit ethernet

political awareness

social distancing

binary verificationism

Answers

Answer:

self-modeling

Explanation:

Robots, which are man-made machines which mimics the actions of man like walking, talking, rendering assistance are part of the future plans to make the society easier. It was mans' attempt to improve the society but still happens to be work in progress.

For the robots to be able to carryout its function, there is need for it to be self modelling in the sense of initiating and executing the commands which was already programmed into it. For example, telling it to walk will be initiated by him as a command, after processing the command, it will execute it without any other information.

Question 4
What methods do phishing and spoofing scammers use? List and explain methods to protect
against phishing and spoofing scams. (10 marks​

Answers

Answer:

The answer is below

Explanation:

There are various methods of phishing and spoofing scammers use, some of which are:

Phishing:

1. Descriptive phishing: here the scammer use fake email to pretend to be a genuine company and steal people's vital details

2. Spear Phishing: here the scammer creates an email that appears there is a connection on the potential victim

3. CEO Fraud: here the scammer target CEO of a company, thereby if successful can fraudulently attack the company due to his access.

Other phishing attacks are vishing, smishing, and pharming, etc.

Spoofing:

1. Email spoofing: here the attacker sends an email through a fake email address to get personal details of a potential victim

2. Caller ID Spoofing: here the attacker makes it appear that he is one specific person, but he is not in the real sense.

3. GPS Spoofing: here the attacker makes it appear he is in a specific location, whereas, he is not.

Others include website spoofing, text message spoofing, Io spoofing etc.

Setting Up Cascading Deletes
Use the drop-down menus to complete the steps to set up cascading deletes between two related tables.
1. Click the
tab
2. In the Relationships group, click Relationships
3. Double-click
4. In the Edit Relationship dialog box, add a check mark next to
5. Click OK
Done

Answers

Answer:

Database Tools, The Line Connecting the Tables, Cascade Delete Related Records

Explanation:

determine the correct usage for styles and themes by placing each characteristic under the correct category​

Answers

Answer:

Styles create bulletin lists and are found in the format tex tab change indentation

Themes change page colors, create message borders, are found under options tab

The difference between a dot matrix printer and a line printer

Answers

Answer:

please give me brain list and follow

Explanation:

Difference Between Dot Matrix and Line Printer is that Dot-matrix printer produce printed images, they produce image when tine wire pins on a print head mechanism strike an inked ribbon. While Line printer is a type of impact printer which is high-speed and printer an entire line at a time.

Answer:

Difference between Dot Matrix and Line printer is that Dot Matrix printer produce printed images, they produce image when tine wire pins on a print head mechanism strike an inked ribbon. While Line printer ia a type of impact printer which is high speed and printer an entire Line at a time.

You have a spreadsheet with population counts for major cities in the United States. Population counts are given in different columns to show breakdown by age groups and gender. The names of cities are listed in rows. You need the population count in column 45 for the city in row 30. What tool could you use to navigate to the cell quickly?

filter

sort

locate

replace

Answers

Answer:

The answer is C. Locate

Explanation: Got it right on edg please mark brainliest

Implement your interface from Chapter using event handling In Chapter your assignment was to Design a universal remote control for an entertainment system (cable / TV, etc). Create the interface as an IntelliJ project. Or to design the telephone interface for a smartphone. Also, create the interface as an IntelliJ project In this assignment, you need to have event listeners associated with the components on the GUI.
The assignment cannot be created using the GUI Drag and Drop features in NetBeans. You must actually code the GUI application using a coding framework similar to one described and illustrated in chapter on GUI development in the courses textbook.
In this assignment you need to have event listeners associated with the components on the GUI. This assignment is about creating a few event handlers to acknowledge activity on your interface. Acknowledgment of activity can be as simple as displaying a text message when an event occurs with a component on your interface such as; a button is pressed, a checkbox or radio button is clicked, a slider is moved or a combo box item is selected.

Answers

Too much to read,Thanks for the points

State three reasons why users attach speakers to their computer​

Answers

Answer:

For listening sake

To listen to information from the computer

They receive audio input from the computer's sound card and produce audio output in the form of sound waves.

what is the determinant of the identity matrix I?​

Answers

Answer:

Explanation:

The ith column of an identity matrix is the unit vector ei (the vector whose ith entry is 1 and 0 elsewhere) It follows that the determinant of the identity matrix is 1, and the trace is n. When the identity matrix is the product of two square matrices, the two matrices are said to be the inverse of each other.

The XYZ daycare has installed a new high-tech system for keeping track of which children are under its supervision at any moment in time. Each parent of a child has a card with a unique ID, where the ID is some integer x. Every morning, the parent swipes the card at a card-reader when dropping their child off at the daycare. The system then adds x to an array of integers. In the evening, when the parent comes to pick up the child, the same card is swiped, and a second copy of x is added to the list. Each night at midnight, the array is wiped clean and reset to have zero elements. In this way, the daycare can quickly check every afternoon which children are yet to be picked up by their parents by picking out the array elements that occur precisely once. Unfortunately, at 4:55 pm on Thursday, April 20, 2017, the daycare realizes that somewhere in their daycare is precisely one child who is yet to be picked up. Can you help them determine the integer ID of this child

Answers

Answer:

Use or Add a log of the actions of the system including the integer, the action,  and the time. Scroll through and see which integer was added but was not removed.

Explanation:

I wouldn't be able to program this, but I think a log is the best solution for this.

which service is a major commercial cloud platform?
a. Microsoft SQL Services
b. SAP Cloud Services
c. Amazon Web Services
d. Oracle Enterprise Services

Answers

Answer: Amazon Web Service

Explanation:

The service that's a major commercial cloud platform is the Amazon Web Service.

Amazon Web Services offers global cloud based products which include databases, storage, networking, IoT, developer tools, analytics, mobile, develo management tools, security applications etc.

The services are of immense benefit to organizations as they help them in achieving their goals as it helps in lowering IT costs, increase speed, enhance efficiency and revenue.

How should you present yourself online?

a
Don't think before you share or like something
b
Argue with other people online
c
Think before you post
d
Tag people in photos they may not like

hurry no scammers

Answers

C maybe ......,,,,.....

Answer: C) Think before you post.

Explanation:

There's a very good chance that whatever you post online will remain there indefinitely. So it's best to think about what would happen if you were to post a certain message on a public place. Keep in mind that you should also safeguard against your privacy as well.

The function below takes one parameter: an integer (begin). Complete the function so that it prints every other number starting at begin down to and including 0, each on a separate line. There are two recommended approaches for this: (1) use a for loop over a range statement with a negative step value, or (2) use a while loop, printing and decrementing the value each time.

1 - def countdown_trigger (begin):
2 i = begin
3 while i < 0:
4 print(i)
5 i -= 1 Restore original file

Answers

Answer:

Follows are code to the given question:

def countdown_trigger(begin):#defining a method countdown_trigger that accepts a parameter

   i = begin#defining variable that holds parameter value

   while i >= 0:#defining while loop that check i value greater than equal to0

       print(i)#print i value

       i -= 2  # decreasing i value by 2  

print(countdown_trigger(2))#calling method

Output:

2

0

None

Explanation:

In this code, a method "countdown_trigger" is declared, that accepts "begin" variable value in its parameters, and inside the method "i" declared, that holds parameters values.

By using a while loop, that checks "i" value which is greater than equal to 0, and prints "value" by decreasing a value by 2.

Design 3 classes: Computer - Superclass
Laptop - Subclass
Desktop - Subclass

You will design these classes to optimize the superclass/subclass relationship by creating instance variables and getter/setter methods.
Include the following instance variables:
int screenSize -
Inches of monitor space
int memory - GB of ram
double batteryLife - Hours of battery life
boolean monitor - Whether or not a monitor is included

Each class should have at least one variable in it.
Once completed, the Tester class should execute without error.

Answers

Answer:

Explanation:

The following code is written in Java. It creates the three classes mentioned and a Tester class that contains the main method. The Computer class contains the memory variable since both laptops and Desktops need memory. The screen size variable is placed separately in the Laptop and Desktop class since desktops may or may not have a monitor so this variable cannot be placed in the Computer class. The batteryLife variable is only in the Laptop class because Desktops do not have batteries. Finally, the monitor variable is only placed in the Desktop class since Laptop's come with built-in monitors. The tester class seen in the picture below tests the creation of both of these objects and it executes without any error.

class Computer {

   int memory;

   public int getMemory() {

       return memory;

   }

   public void setMemory(int memory) {

       this.memory = memory;

   }

}

class Laptop extends Computer {

   int screenSize;

   double batteryLife;

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

   public double getBatteryLife() {

       return batteryLife;

   }

   public void setBatteryLife(double batteryLife) {

       this.batteryLife = batteryLife;

   }

}

class Desktop extends Computer {

   boolean monitor;

   int screenSize;

   public boolean isMonitor() {

       return monitor;

   }

   public void setMonitor(boolean monitor) {

       this.monitor = monitor;

   }

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

}

class Tester {

   public static void main(String[] args) {

       Laptop computer1 = new Laptop();

       Desktop computer2 = new Desktop();

   }

}

In which category would Jamal most likely find an appropriate template for his report?

Designs
Diagrams
Education
Personal

Answers

Answer:

Education

Explanation:

which optical storage media has greatest storage capacity?​

Answers

A Blu-ray Disc has the greatest storage capacity.

The optical storage media has greatest storage capacity is Single-layer, single-sided Blu-ray disc.

What is the  Blu-ray disc.

A Blu-ray disc can store the most information compared to other types of optical discs. A one-sided Blu-ray disc can store around 25 GB of information.

Dual-layer or double-sided discs are discs that have two layers or two sides, which allows them to store more information. New Blu-ray discs with 20 layers can store up to 500 GB of data. Small DVDs can save about 4. 7 GB of data. A DVD that has two layers or can be played on both sides can store up to 8. 5 GB of data. If it is both dual-layer and double-sided, it can hold up to 17 GB of data.

Read more about  Blu-ray disc here:

https://brainly.com/question/31448690

#SPJ6

Write a Python program that allows the user to enter any number of non-negative floating-point values. The user terminates the input list with any negative value. The program then prints the sum, average (arithmetic mean), maximum, and minimum of the values entered. Algorithm: Get all positive numbers from the user Terminate the list of numbers when user enters a negative

Answers

Answer:

The program in Python is as follows:

nums = []

isum = 0

num = int(input("Num: "))

while num >= 0:

   isum+=num

   nums.append(num)

   num = int(input("Num: "))

   

print("Sum: ",isum)

print("Average: ",isum/len(nums))

print("Minimum: ",min(nums))

print("Maximum: ",max(nums))

Explanation:

My solution uses list to answer the question

This initializes an empty list, num

nums = []

This initializes the sum of the input to 0

isum = 0

This prompts the user for input

num = int(input("Num: "))

The loop is repeated until the user enters a negative number

while num >= 0:

This calculates the sum of the list

   isum+=num

This appends the input to the list

   nums.append(num)

This prompts the user for another input

   num = int(input("Num: "))

   

This prints the sum of the list

print("Sum: ",isum)

This prints the average of the list

print("Average: ",isum/len(nums))

This prints the minimum of the list

print("Minimum: ",min(nums))

This prints the maximum of the list

print("Maximum: ",max(nums))

Write an application that combines several classes and interfaces.

Answers

Answer:

Explanation:

The following program is written in Java and it combines several classes and an interface in order to save different pet objects and their needed methods and specifications.

import java.util.Scanner;

interface Animal {

   void animalSound(String sound);

   void sleep(int time);

}

public class PetInformation {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       String petName, dogName;

       String dogBreed = "null";

       int petAge, dogAge;

       Pet myPet = new Pet();

       System.out.println("Enter Pet Name:");

       petName = scnr.nextLine();

       System.out.println("Enter Pet Age:");

       petAge = scnr.nextInt();

       Dog myDog = new Dog();

       System.out.println("Enter Dog Name:");

       dogName = scnr.next();

       System.out.println("Enter Dog Age:");

       dogAge = scnr.nextInt();

       scnr.nextLine();

       System.out.println("Enter Dog Breed:");

       dogBreed = scnr.nextLine();

       System.out.println(" ");

       myPet.setName(petName);

       myPet.setAge(petAge);

       myPet.printInfo();

       myDog.setName(dogName);

       myDog.setAge(dogAge);

       myDog.setBreed(dogBreed);

       myDog.printInfo();

       System.out.println(" Breed: " + myDog.getBreed());

   }

}

class Pet implements Animal{

   protected String petName;

   protected int petAge;

   public void setName(String userName) {

       petName = userName;

   }

   public String getName() {

       return petName;

   }

   public void setAge(int userAge) {

       petAge = userAge;

   }

   public int getAge() {

       return petAge;

   }

   public void printInfo() {

       System.out.println("Pet Information: ");

       System.out.println(" Name: " + petName);

       System.out.println(" Age: " + petAge);

   }

   //The at (email symbol) goes before the Override keyword, Brainly detects it as a swearword and wont allow it

   Override

   public void animalSound(String sound) {

       System.out.println(this.petName + " says: " + sound);

   }

//The at (email symbol) goes before the Override keyword, Brainly detects it as a swearword and wont allow it

  Override

   public void sleep(int time) {

       System.out.println(this.petName + " sleeps for " + time + "minutes");

   }

}

class Dog extends Pet {

   private String dogBreed;

   public void setBreed(String userBreed) {

       dogBreed = userBreed;

   }

   public String getBreed() {

       return dogBreed;

   }

}

function of dobji dzong​

Answers

Answer:

Dobji is consider to be the first model dzong in Bhutan

Other Questions
Which is the BEST topic sentence for this letter ? number 2 represents the country of? Please? I really need this answer if you can The chart indicates the education of three different employees. Which best matches the employee and their potential career? Hallie is qualified to be a Dentist, Oran is qualified to be a Video Game Designer, and Wade is qualified to be a Carpet Installer. Hallie is qualified to be a Carpet Installer, Oran is qualified to be a Dentist, and Wade is qualified to be a Video Game Designer. Hallie is qualified to be a Video Game Designer, Oran is qualified to be a Dentist, and Wade is qualified to be a Carpet Installer. Hallie is qualified to be a Dentist, Oran is qualified to be a Carpet Installer, and Wade is qualified to be a Video Game Designer. Determine whether the set of lengths could form a triangle.5, 2, and 3. 12 is what% of 200? What is an immune response? How many liters is 3.3 moles of a gas? What is the role of the respiratory system?What happens when you breathe?What happens in the circulatory system?What are the structures of the heart?How does blood flow through the circulatory system?What does blood contain? Ben is throwing a ball across a 48-yard field. He threw it of the way across the field. How far did Ben throw the ball? 11 points pls help moby max A paved blacktop parking lot was built on what wasonce a soil-covered field. This area will nowexperience increased runoff when rain occurs becausethe paved parking lot hasA) less capillarity B) less permeabilityC) greater infiltration D) greater porosity write it in your own wordsWhy is it important to know there are good and bad bacteria? is 10x-5=8x-2x + 7 -2 equivalent? Alex, Ben, Chuck, and David all called in to a radio show to get free tickets to a concert. List all the possible orders in which their calls could have been received. what exercises can i do to lose weight!!!!! 7. How and when did the Mongols conquer China? Ill make you brainliest! Explain why America declared a war on terrorism. Tetrachloroethene, C2C14 is a solvent used in many dry cleaning processes.Write the empirical formula for tetrachloroethene. what is one way thoreau encourages people to show their disapproval of the government