Create 2 variables
thisGoesUp initialized to 100
thisGoesDown initialized to 100
Write a program that uses the Increment and Decrement Operators to increase thisGoesUp by 1 and decrease thisGoesDown by 1.
Print out the results.
Sample output:
thisGoesUp = __
thisGoesDown = __
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
public class Test{
public static void main(String []args){
int thisGoesUp=100;
int thisGoesDown=100;
thisGoesUp++;
thisGoesDown--;
System.out.println("thisGoesUp = "+thisGoesUp);
System.out.println("thisGoesDown = "+thisGoesDown);
}
}

Kindly revert for any queries
Thanks.
Create 2 variables thisGoesUp initialized to 100 thisGoesDown initialized to 100 Write a program that uses...
Write a C program that has a local and a global variable. The program uses a fork to create a child process. The parent process modifies both variables to be 10 and 20 and prints out the values. Then the child process modifies both variables to be 100 and 200 and prints out the values? Explain the program output?
Write a C++ program and algorithm to create a class of fraction having variables numerator and denominator, and member functions setting and getting values of the fractions. Also create a static member variable of the class having fraction value tolerance of 0.1. Instantiate 10 fraction objects and find out how many of them are below and above tolerance level. Decrement the tolerance to 0.01 by a static member function and find out how many of them are now above and...
C++ This chapter uses the class rectangleType to illustrate how to overload the operators +, *, ==, !=, >>, and <<. In this exercise, first redefine the class rectangleType by declaring the instance variables as protected and then overload additional operators as defined in parts 1 to 3. Overload the pre- and post-increment and decrement operators to increment and decrement, respectively, the length and width of a rectangle by one unit. (Note that after decrementing the length and width, they...
Write a statement that uses the decrement operator, in prefix mode, to decrease the value of the variable time. Write a statement that uses the increment operator, in postfix mode, to increase the value of the variable points. (Please do this in C++)
Write a C program for a program to implement a recursive main. Include a static local variable count initialized to 1. Post increment and print the value of count each time the main is called. The loopcount included in the usage is a positive integer number that will indicate how deep the recursion should go. Usage: lab3 loopcount Code should be nicely indented and commented. Create a simple Makefile to compile your program into an executable called lab3. You should...
How to write a program that create a car class
with:
instance
variables name and mpg (make public)
No need for a
main() method
In a separate file, create a CompareCars class with a
main()method
create 2
instances of car using new
set the name and
mpg for each
instance
variables are public, so use the name an mpg to access the instance
variables
compare the
fuel efficiency of your 2 cars and print out which is more
efficient to...
The goal of this assignment is to write a multithreaded program (Task3.c) that explores synchronization challenge 1. Assume that we have a shared variable CurrentiD. This is initialized to 1 at the beginning. 2. Now create 5 threads in your program and assign ID 1,2,3,4,5 to them respectively. You can pass the ID as a parameter when you create the threads. Each of the threads will try to access the variable "CurrentiD" Whenever a thread acquires the variable, it checks...
Write the following program in Java. Create an abstract Vehicle class - Vehicle should have a float Speed and string Name, an abstract method Drive, and include a constructor. Create a Tesla class - Tesla inherits from Vehicle. - Tesla has an int Capacity. - Include a constructor with the variables, and use super to set the parent class members. - Override Drive to increase the speed by 1 each time. - Add a toString to print the name, speed,...
Write a C program that uses mallloc to create a 2D array. of c columns and r rows. Elements of array must be initialized to 0 and you must use malloc and free allocated memory fo array.
Write a program that: program starts; declares and initializes to 10 an integer variable i; uses a do loop; print on new line “loop pass # “ and i; if i = 4 break default decrement i by 1 by stating i once; test condition i > 0; just before ending print on new line “Program finished!” then terminate program.