Declare/Create an integer variable named num
Declare/Create a character variable named word
Declare/Create a double variable named price
Declare/Create a boolean variable named tester
*hint remember that when you declare/create a variable you give it a data type, name, and use a semicolon
ANSWER :
Example program where you can declare the the above variables in a
code
Code :
import java.util.*
public class Main
{
public static void main(String[] args) {
int num; //this is an int datatype
char word; // this is a char datatype
double price; //this is an double datatype
Boolean tester; //this is bool datatype
}
}
EXPLAINATION :
Here num is an integer datatype,word is a character datatype, price is a double datatype and tester is a boolean datatype.
Declare/Create an integer variable named num Declare/Create a character variable named word Declare/Create a double variable...
Create a script that presents a word guessing game. Allow users to guess the word letter-by-letter by entering a character in a form. Start by assigning a secret word to a variable named $secret. After each guess, print the word using asterisks for each remaining letter but fill in the letters that the user guessed correctly. You need to store the user’s guess in a hidden text field name $hidden_guess. For example, if the word you want users to guess...
Java:
Create the skeleton.
Create a new file called ‘BasicJava4.java’
Create a class in the file with the appropriate name.
public class BasicJava4 {
Add four methods to the class that return a default value.
public static boolean isAlphabetic(char aChar)
public static int round(double num)
public static boolean useSameChars(String str1, String
str2)
public static int reverse(int num)
Implement the methods.
public static boolean isAlphabetic(char aChar):
Returns true if the argument is an alphabetic character, return
false otherwise. Do NOT use...
C++ pointers and linked lists 1. Declare an integer pointer variable intPointer. Initialize it to point to an int variable named someInt. Assign the value 451 to someInt and output (cout) the variable someInt and output (cout) the value pointed to by intPointer. Write an assignment statement that indirectly stores 900 into the value pointed to by intPointer. Output (cout) the value pointed to by intPointer and output (cout) the variable someInt, 2. Declare a pointer variable charArrPointer and initialize...
Write a line of code that will declare a file variable named data. Assuming that the variable data was correctly created in the previous problem, write a line of code that will associate the variable with a file named grades.txt that is being opened for reading. Assuming that grades.txt only contains integers, write a line of code that will use the variable data to read in the first integer and store in a variable named test1 that has already been...
implicit none ! Declare File Read Variables CHARACTER(255) :: Line INTEGER :: CP ! Character position in Line INTEGER :: File_Read_Status ! Declare character constants CHARACTER :: Tab > ACHAR(1) CHARACTER :: Space = " " ! Read all lines in the file DO READ(*,'(A)',iostat = File_Read_Status) Line ! Exit if end of file IF (File_Read_Status < 0) EXIT ! Skip leading white space DO CP = 1, LEN_TRIM(Line) IF...
Problem 1 (6 Points) Create the following variables in the code: Scalar Character (or single letter string) An array of 6x1 A matrix of 2x4 The values could be anything; however, make sure you agree with the variable type the workspace is telling you. You need to have four variables in your workspace after you are done declaring them. Remember that every value (scalar, character, array, or matrix) needs to have a variable name-ans is not an accepted variable name....
Create a class named Cash. Include one private integer variable to hold the number of dollars and one to hold the number of cents. Create your own accessor and mutator functions to read and set both member variables. Create a function that returns the amount of money as a double. Test all of your functions. Use at least 4 Cash objects. Must be done in c++
10 5. Create a structure named MyStruct containing two fields: field1, a single word, and field2, an array of 20 doublewords. The initial values of the fields may be left undefined. 6. Declare a variable as an array of 20 MyStruct objects. 7. Write a macro named mGenRandom that generates a random integer between 0 and n-1. Let n be the only parameter. 8. What is the purpose of the IFB directive?
1. Create a table that is named test_table. This table should have two columns named test_id and test_description. These columns should be defined to store the following type of data, respectively: test_id stores numeric data that is a maximum of 3 characters in size; test_description stores variable character data that is a maximum of 25 characters in size.(Hint: Refer to SQL Example 2.1) 2. Insert two rows into the test_table as follows: INSERT INTO test_table VALUES (1, 'Test1'); INSERT INTO...
In a project named 'DogApplication', create a class called 'Dog' 1. declare two instance variables in 'Dog' : name (String type) age (int type) 2. declare the constructor for the 'Dog' class that takes two input parameters and uses these input parameters to initialize the instance variables 3. create another class called 'Driver' and inside the main method, declare two variables of type 'Dog' and call them 'myDog' and 'yourDog', then assign two variables to two instance of 'Dog' with...