6742 Shares

Write a programme to display the contents of a given text file. Also write a code toappend the contents to t?

Write a programme to display the contents of a given text file. Also write a code toappend the contents to t? Topic: Homework display
July 16, 2019 / By Sheree
Question: Write a C programme to display the contents of a given text file. Also write a code to append the contents to the given text file.? I am new to C programming and need you help to complete the project.....thanks in advance
Best Answer

Best Answers: Write a programme to display the contents of a given text file. Also write a code toappend the contents to t?

Peggie Peggie | 3 days ago
Hey ninpun, are u testing us or are u asking us for help. U have forgotten these points buddy - The language u want the program in & if this is ur homework try to solve it first then ask us !!
👍 194 | 👎 3
Did you like the answer? Write a programme to display the contents of a given text file. Also write a code toappend the contents to t? Share with your friends

We found more questions related to the topic: Homework display


Peggie Originally Answered: Creating java file, please how do i write this code?
here is the answer, i did it in two ways for you. one using loop and other using recursion. choose as u wish. import java.util.Scanner; public class Barcode { private final int MAX_COUNT = 12; private final long DIVIDER = 100000000000L; private long number = 0; private long remainder = 0L; private boolean valid = false; public Barcode( long number ){ this.number = number; //uncomment one at a time to use validate(); //validateRecursive(); } private void validateRecursive(){ long[] sums = new long[2]; validate( number, DIVIDER, sums); sums[1] *= 3; remainder = (sums[1] + sums[0]) % 10; valid = remainder == 0; } private int validate(long number, long divider, long[] sums){ long num = 0L; if(divider == 0){ return MAX_COUNT; } num = number/(divider); int position = validate (number % divider, divider / 10, sums); if(position%2 == 0){ sums[0] += num; }else{ sums[1] += num; } return position-1; } private void validate(){ long num = 0L; long temp = number; long divider = DIVIDER; long oddsSum = 0L; long evensSum = 0L; for(int i = 1 ; i<=MAX_COUNT ; i++){ num = temp/divider; temp %= divider; divider /= 10; if(i%2 == 0){ evensSum += num; }else{ oddsSum += num; } } oddsSum *= 3; remainder = (oddsSum + evensSum) % 10; valid = remainder == 0; } public boolean isValid(){ return valid; } public long getBarcodeNumber(){ return number; } public void print(){ System.out.println( "The barcode is valid if the output is 0." ); System.out.println( "Output = " + remainder ); } public static void main( String[] args ){ Scanner input = new Scanner( System.in ); long barcodeNumber = 0; Barcode barcode = null; while( barcodeNumber != -1 ){ System.out.print( "\nInput a 12-digit barcode(cannot start with zero):\n>> " ); barcodeNumber = input.nextLong(); if( barcodeNumber != -1 ){ barcode = new Barcode( barcodeNumber ); barcode.print(); } } } }
Peggie Originally Answered: Creating java file, please how do i write this code?
No...java is an interpreted language and not a compiled or a pre-compiled language. So .exe can not be made. yet JDK kit are very effective to run any java record on any gadget presented java is put in top on that. JDK materials a lot of kit to make java courses transportable.

Marinda Marinda
Bert, I think you missed 1 0 in the middle, you won't be able to display the file if it contains more than 2^16 chars ;) Is this a quiz or a proper question? Your desired operating system. Desired programming language. Desired text file syntax. No? anything? Then go with Bert's solution, 20 points for him.
👍 80 | 👎 1

Marinda Originally Answered: Backpacking contents?
First aid kit, fire starter, space blanket, water purifier are all essential things that should always be in a backpack.
Marinda Originally Answered: Backpacking contents?
Well since that's primarily for military use I would not use it since for backpacking getting shot or having an ied go off along the trail is not likely either. The biggest issues with backpacking are blisters, burns bug bites and minor cuts or scrapes. These can be dealt with much smaller and light weight first aid kits. here is a first aid kit check list, it's quite extensive so modify as to your specific needs, http://www.rei.com/expertadvice/articles... Here is an article on how to choose a back packers first aid kit http://www.rei.com/expertadvice/articles... Here is what I carry http://www.rei.com/product/800906/rei-ba...

If you have your own answer to the question homework display, then you can write your own version, using the form below for an extended answer.