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
COMPLETE IN C++ Declare and initialize a global constant named SIZE with the value 50. Write...
COMPLETE IN C++ Declare and initialize a global constant named SIZE with the value 50. Write a void function called count that accepts two parameters-- a C-string called str representing a C-string passed to the function and an array of integers called alphabets to store the count of the letters of the C-string. Note that the alphabets array stores 26 counters – one for each letter of the alphabet. Use the same counter for lowercase and uppercase characters. The first...
Objectives: ⦁   Declare and initialize null-terminated string ⦁   Apply indirect address ⦁   Write loop ⦁   Apply...
Objectives: ⦁   Declare and initialize null-terminated string ⦁   Apply indirect address ⦁   Write loop ⦁   Apply Irvine.inc library functions to display a string Problem Description: Write a program with a loop and indirect address that copies a string from source to target. Revising the character order in the process. Use the following variables: source BYTE “This is the string that will be reversed”, 0 target BYTE SIZEOF source DUP(‘#’) You may refer to the Programming Exercise #7 on Page 138...
in separate statements: 1- Declare a variable to keep a grade and another one to keep...
in separate statements: 1- Declare a variable to keep a grade and another one to keep the name of the course. Be sure to come up with proper identifiers/names and type for these variables. 2- Initialize the variables (it is ok to hard code). Write one statement that prints the values of both of these variables.
20. If you do not initialize a string variable, it begins with a special value known...
20. If you do not initialize a string variable, it begins with a special value known as -----------------. Group of answer choices NA blank null string 21. Which one of the following statements assigns the value contained in the Text property of a TextBox control named ageTextBox to the Text Property of a Label control named ageLabel? Group of answer choices b. ageTextBox.Text = ageLabel.Text; d. ageTextBox = ageLabel; c. ageLabel.Text = ageTextBox.Text; a. ageLabel = ageTextBox; 22. Assuming a...
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)
Develop a program that uses four signed, global, short variables A, B, C, D Initialize each...
Develop a program that uses four signed, global, short variables A, B, C, D Initialize each variable A, B, C, D to a different positive one-digit value Somehow print the four values in order A B C D, space separated Print a newline character Reorder the values in the variables from the order A, B, C, D to B, C, D, A A -> B B -> C C -> D D -> A Somehow print the four values in...
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,...
2. Write a java program to: Define 3 integer variables var4, var5, and var6. Initialize these...
2. Write a java program to: Define 3 integer variables var4, var5, and var6. Initialize these variables with numbers input from console Right shift values in var4, var5 and var6, so var6 will get var5’s value, var5 will get var4’s value and var4 will get var6’s value Calculate the average of these numbers and save it into variable avg Display the following message: “the average of numbers value4, value5 and value6 is average-value”. (value4, value5, value6 and average-value should be...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT