Complete Question:
Write code that prints: Ready! userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after each line of text Ex: userNum = 3 outputs: Ready! 3 2 1 Blastoff!
Answer:
public class TestClock {
public static void main(String[] args) {
int userNum= 3;
System.out.print("Ready! "+userNum+" ");
for (int i=userNum;i>1; i--){
userNum--;
System.out.print(userNum+" ");
}
System.out.println("Blasoff!");
}
}
Explanation:
- Create and initialize userNum
- Use System.out.print to print the sequence ("Ready! "+userNum+" ") on same line
- use for statement with this condition for (int i=userNum;i>1; i--) decremeent userNum by 1 after each loop iteration and print userNum on same line
- outside the for loop print "Blasoff!"
Hey there!
Let's assume that this question is referring to every digital calendar ever made. As in, even those made on devices without internet connectivity or any other fancy features that we utilize with many digital calendars today.
If a planning device that came with a digital calendar didn't have internet connectivity, it wouldn't be able to be connected to the cloud. Back when these devices were around, it wasn't even plausible to store things like calendar events and contacts in what we know as the "cloud". Also, these devices probably had to be hardwired to a computer and new software had to be downloaded to them, so the updates weren't automatic. Archaic, right?
Also, consider the fact that even reputable websites/companies such as Google with Google Calendars or Apple with iCalendar will never go without their malfunctions or threats. Sometimes, these websites can be hacked and the data that they contain can be compromised, especially if they're stored on the cloud. Also, even though it's not realistic, Google or Apple could one day decide to completely get rid of their calendar programs altogether. So, this means that digital calendars are definitely able to be destroyed or lost.
That just leaves "They can be used anywhere". This is true, even with those archaic devices specifically used for scheduling events and such. Nowadays, you have your phone and possibly a laptop on you at all times, which will likely have a calendar on it as a stock application. So, I think this is your answer.
Hope this helped you out! :-)
This is true.
The next step in an innovation stream is an era of ferment, which is later followed by dominant design.
Answer:
Option(d) i.e "storing a float in an int" is the correct answer for the given question.
Explanation:
- Typecast is used for the changing the one datatype to the another datatype Their are two types of casting
1 implicit
In this typecast we change the smaller datatype into the larger datatype.
For example
int to float
2 Explicit
In this typecast we change the larger datatype into the smaller datatype in an explicit manner.
For example
float to int.
- in the given question we required the casting in the option(d) i.e "storing float in an int" That's why this option is correct and all other options are incorrect.
Answer:
import java.util.Scanner;
public class Speed{
int speed;
public Speed(int speed){
this.speed = speed;
}
public void checkSpeed(){
if(speed >= 24 || speed <= 56){
System.out.println("Speed is normal");
}
else
System.out.println("Speed is abnormal");
}
public static void main(String...args){
Scanner input = new Scanner(System.in);
int userSpeed = 0;
System.out.println("Enter a speed: ");
userSpeed = input.nextInt();
Speed obj1 = new Speed(userSpeed)
obj1.checkSpeed();
}
Explanation: