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...
Summary In this lab, you declare and initialize variables in a C++ program. The program, which...
Summary In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.cpp, calculates your age in the year 2050. Instructions Declare an integer variable named myNewAge. Declare and initialize an integer variable named myCurrentAge. Initialize this variable with your current age. Declare and initialize an integer variable named currentYear. Initialize this variable with the value of the current year. Use four digits for the year. Execute the program by...
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...
public class Bicycle { // Instance variables (fields) private String ownerName; private int licenseNumber; // Constructor...
public class Bicycle { // Instance variables (fields) private String ownerName; private int licenseNumber; // Constructor public Bicycle( String name, int license ) { ownerName = name;    licenseNumber = license; } // Returns the name of the bicycle's owner public String getOwnerName( ) { return ownerName; } // Assigns the name of the bicycle's owner public void setOwnerName( String name ) { ownerName = name; } // Returns the license number of the bicycle public int getLicenseNumber( ) {...
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
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT