Question

Declare four string variables. Declare each one separately. Do not initialize the variables. Then write the...

Declare four string variables. Declare each one separately. Do not initialize the variables.

Then write the above question so that all variables are declared at once

Homework Answers

Answer #1

here you will see 2 programing languages for implementing vaiable in c and java.

In c::

string means::string is  a collection of characters in a linear sequence.

In 'C' always treats a string a single data even though it contains whitespaces .

examples::

syntax :: datatype <variable_name>[size];
char  variable1[30];    //declaration of a string variable1
char  variable2[30];    //declaration of a string variable2 
char  variable3[30];     //declaration of a string variable3
char variable4[30];      //declaration of a string variable4

Note: : c compiler automatically adds a NULL character ' \0' to the character array created..

in Java::

String variable1; //declaration of a string

String variable2; //declaration of a string

String variable3; //declaration of a string

String variable4; //declaration of a string

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a C++ program to do the following: Declare and assign values to int variables x,...
Write a C++ program to do the following: Declare and assign values to int variables x, y Declare an int variable z; and store the sum of x and y in it Declare a pointer called pz and point it in the heap direction (using new) Store the z value in the heap location using the pz pointer Print the content of the pz pointer Print the pointer (the address)
Note: Do not use classes or any variables of type string to complete this assignment Write...
Note: Do not use classes or any variables of type string to complete this assignment Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along...
public class Auto { private String make; private String model; private int year; } a) write...
public class Auto { private String make; private String model; private int year; } a) write a default constructor for the Auto Class n) Write a constructor to initialize all instance variables c) write accessor and mutator for make variable d) create an onject name it myAuto with values of Toyota, Camry, and 2016
Write a Java code to complete the following operations: (1) Define a double variable var1, initialize...
Write a Java code to complete the following operations: (1) Define a double variable var1, initialize it with value 9.99 (2) Given two integer variables var2 and var3, write a statement that gives var3 a value that is 4 more than the value of var2. (3) Define a double variable var4, initialize it with value 1234.56. Write a statement to change var4 so it will just hold one third (1/3) of the original value (4) Given four double variables var5,...
java Write a single Java statements to accomplish each of the following: a) Displaythevalueoftheseventhelementofcharacterarraych. b) Considering...
java Write a single Java statements to accomplish each of the following: a) Displaythevalueoftheseventhelementofcharacterarraych. b) Considering “Scanner in = new Scanner (System.in);”, input a value into element 5 of one-dimensional double array nums. c) Initialize each of the four elements of the one-dimensional integer array test to 7. d) Declare and create an array called table as a float array that has four rows and three columns. e) Considering the following ArrayList declaration, insert “test” at the fourth position (index...
Each string on a violin is tuned a fifth higher than the one below it (there...
Each string on a violin is tuned a fifth higher than the one below it (there are four strings; from lowest pitch to highest they are G, D, A, and E), so that each has a frequency 3/2 that of the one below it. The A string typically has a frequency of 440 Hz, a diameter of 0.45mm and a bridge-to-pegbox length of 325 mm. Assume the strings are made of steel (density 7800 kg/m3). a. What is the tension...
Queues, Lists, and Stacks Assignment: Write client methods to do the following Assume that there exists...
Queues, Lists, and Stacks Assignment: Write client methods to do the following Assume that there exists in main a list   declared as : List<Integer> aList   =   new   List<Integer>(50); Write a client method called bubbleSort which given a list as a parameter uses the bubble sort algorithm to sort the contents of the list. YOU MAY ASSUME that there exists a method called swap (with the following signature) which swaps the contents of two elements: // swap public static void swap(List<Integer>...
Write a Python program that splits, doubles, and reverse each input string entered. For each string,...
Write a Python program that splits, doubles, and reverse each input string entered. For each string, split it at the given integer, and then output it in format as shown below. Convert all stings entered to uppercase for output. Assume string length is greater than the split value. Refer to the sample output below. Sample Runs: Enter a string: holiday Enter the number to split on: 3 HOL-YADI-LOH-IDAY Enter a string: TATTARRATTAT Enter the number to split on: 6 TATTAR-TATTAR-RATTAT-RATTAT...
Perl Programming Language 1) Write a Perl script to concatenate "This is String One" and "This...
Perl Programming Language 1) Write a Perl script to concatenate "This is String One" and "This is String Two". Print all three strings, one per line with its length. Output: This is String One (print length here) This is String Two (print length here) This is String One This is String Two (print length here) 2) Write a Perl function that creates an array using qw function with the month names. It then prints the elements 4 and 7 (May...
Write a program that determines whether an input string a palindrome; that is whether it can...
Write a program that determines whether an input string a palindrome; that is whether it can be read the same way forward and backward. At each point, you can read only one character of the input string; do not use an array to first store this string and then analyze it (except, possibly in a stack implementation). Consider using multiple stacks. PLEASE PROVIDE A PSEUDOCODE
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT