#12 Coding Challenge-2 Part 2 | Java Tutorial Series 📚 in Tamil | EMC Academy
HTML-код
- Опубликовано: 8 сен 2024
- Welcome back to the EMC Academy Java Tutorial Series! In this video, we delve deeper into our coding challenge based on the concepts covered in our previous tutorials. Building upon the foundational knowledge from Part 1, Part 2 continues our exploration into Java programming with engaging challenges designed to reinforce your understanding and enhance your coding skills. Join us as we navigate through real-world scenarios, applying the concepts and techniques learned so far. Whether you're a beginner or an experienced coder looking to sharpen your Java skills, this video promises to be both informative and challenging. Stay tuned, and let's dive into the world of Java programming together! Don't forget to like, share, and subscribe for more content from EMC Academy. Happy coding! 🚀📝
Java in Tamil.
Join our 700K+ Instagram community
www.instagram....
Question 3:
import java.util.Scanner;
class demo {
public static void main(String[] args) {
Scanner scan=new Scanner (System.in);
String color=scan.nextLine();
if(color.equals("red"))
{
System.out.print("Stop");
}
else if(color.equals("yellow"))
{
System.out.print("Get ready");
}
else if(color.equals("Green"))
{
System.out.print("Go");
}
}
}
bro else if next else bro
In public void statement there is a small error pls, check it bro
//Q3
import java.util.Scanner;
class exercise {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String a = scan.nextLine();
if(a.equals("red")){
System.err.println("STOP");
}
else if(a.equals("yellow")){
System.err.println("GET READY");
}
else{
System.err.println("GO");
}
}
}
Q3.
import java.util.Scanner;
class demo3 {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("What is the color of the traffic light?");
String traffic_color = scan.nextLine();
if (traffic_color.equals("red")) {
System.out.print("Stop");
}
else if(traffic_color.equals("yellow")) {
System.out.print("Get Ready");
}
else if(traffic_color.equals("green")) {
System.out.print("Go");
}
else {
System.out.print("Incorrect Input");
}
}
bro your teaching easy to understand, thanks bro
Thanks bro!
Ouestion no 3
Import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner colors=new Scanner(System.in);
String color=colors.nextLine();
if(color.equals("red")){
System.out.println("stop");}
else if (color.equals("yellow")){
System.out.println("ready");}
else{
System.out.println("go"); }
}
}
Your teaching is easily understandable bro. Thank you so much ❤
Q3:
import java.util.Scanner;
class hello{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
String light = scan.nextLine();
if(light.equals("red")){
System.out.print("stop");
}
else if(light.equals("yellow")){
System.out.print("get ready");
}
else if(light.equals("green")){
System.out.print("go");
}
}
}
import java.util.Scanner;
class exam {
public static void main (String args[]){
Scanner scan = new Scanner(System.in);
String color = scan.nextLine();
if(color.equals("red")){
System.out.println("STOP");
}
else if(color.equals("yellow")){
System.out.println("READY TO GO");
}
else if (color.equals("green")){
System.out.println("GO");
}
}
}
rmbhaa usefull bro video continue pannungaaa pathilaa break pannanmaa
public class q3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("what is the color of the traffic light? (Enter only Red or Green or Yellow)");
String clr = scan.nextLine().trim().toLowerCase();
if(clr.equals("red")){
System.out.println("Stop");
}
else if(clr.equals("yellow")){
System.out.println("Get Ready");
}
else if(clr.equals("green")){
System.out.println("Go");
}
else {
System.out.println("invalid input!!");
}
}
}
Bro what for-trim()
import java.lang.system;
import java.util.scanner;
Class traffic{
public static void main (String arg[ ])
{ scanner obj=new scanner(system.in);
String color=obj.nextLine();
if(color.equals("red"))
{ System.out.print("Stop");
}
else if(color.equals("yellow"))
{ System.out.print("Get Ready");
}
else if(color.equals("green"))
{
System.out.print("Go")
}
}
}
Q2..
If u enter the mark in terminal
U must put another condition.y because
Score 1 .. 21
S2. 22
S3 500
S4 00
S5 30
Then this is also pass.
So we correct code for mark condition
Bro total 5score panra Nala athu percent 35 greater than pass varuthu so not problem
import java.util.Scanner;
class Demo{
public static void main(String[] args) {
Scanner co = new Scanner(System.in);
System.out.println("enter the color");
String color = co.nextLine();
if(color.equals("red")) {
System.out.println("Stop"); }
else if(color.equals("yelleow")) {
System.out.println("Ready"); }
else if(color.equals("green")) {
System.out.println("Goo"); }
}
}
package balaji;
import java.util.Scanner;
public class red {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
String a=scan.nextLine();
if(a.equals ("red"))
{
System.out.print("stop");
}
else if(a.equals("yellow"))
{
System.out.println("wait");
}
else if (a.equals("green"))
{
System.out.println("go");
}
else
{
System.out.println("not defined");
}
}
}
Anna videos podrathuku romba. Thanks
Super and thanks bro ❤
import java.util.Scanner;
class hello{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
String trafficLight = scan.nextLine();
if(trafficLight.equals("red"))
{
System.out.print("Stop");
}
else if(trafficLight.equals("yellow"))
{
System.out.print("Get Ready");
}
else if(trafficLight.equals("green"))
{
System.out.print("Go");
}
}
}
Q3 answer:
import java.util.Scanner;
public class Learning{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String color = scan.nextLine();
if (color.equals("red") || color.equals("Red")){
System.out.println("color is " + color + " so stop");
} else if (color.equals("green")){
System.out.println("color is " + color + " so go");
}else if (color.equals("yellow")){
System.out.println("color is " + color + " so get ready");
}else {
System.out.println("invalid color");
}scan.close();
}}
why we have to give .nextLine insted of .nextInt ??
@@sugithraj9203 because we are getting a string from the user
if for getting integer from the use then we have to use .nextInt
@@sugithraj9203 for string, use nextLine
for int, use nextInt
fro double, use nextDouble
like wise, based on datatype, you have to
use accordingly
# Question 3 :
import java.util.Scanner;
class looping{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String color = scan.nextLine();
if(color.equals("red") ){
System.out.println("STOP");
}
else if(color.equals("Yellow") ){
System.out.println("Get ready");
}
else if(color.equals("Green") ){
System.out.println("Go");
}
}
}
Bro stringa vachi oru example podunga bro user kitta input vangramathiri
import java.util.Scanner;
class hello {
public static void main(String[] args) {
Scanner devil = new Scanner(System.in);
String coler = devil.nextLine();
if(coler.equals("red"))
{
System.out.println("Stop.");
}
if(coler.equals("yellow"))
{
System.out.println("Get Ready.");
}
if(coler.equals("green"))
{
System.out.println("Go.");
}
}
}
import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
Scanner traffic = new Scanner(System.in);
String colour = traffic.nextLine();
if(colour.equals("red"))
{
System.out.println("STOP");
}
else if(colour.equals("yellow"))
{
System.out.println("Get Ready");
}
else if(colour.equals("Green"))
{
System.out.println("GO");
}
}
}
Could you please teach me about the MVC (Model-View-Controller) and MVVM (Model-View-ViewModel) patterns in Flutter or any other common
thank you bro
public class hello {
public static void main(String[] args){
System.out.println("Enter five subject Marks:");
Scanner m=new Scanner(System.in);
String color=m.nextLine();
if(color.equals("red")){
System.out.print("stop");
}
else if (color.equals("yellow"))
{
System.out.print("ready");
}
else if (color.equals("green"))
{
System.out.print("go");
}
}
package Exercise_EMC;
public class Exercise13 {
public static void main(String args[]) {
// nested if
int score = 70;
if (score < 50) { // less than
System.out.println("You need to improve");
} else if(score == 50 && score
Hello bro in this video i have understood all the things but from 15:00 min while typing Sys.out.print statement it showing x or s symbol what it indicates bro like System.out.Println(x:"Enter your salary: ");. Thanks in advance
Same doubt do you answer now
Complete the traffic signal program bro🥳✨
If( salary>=20000 && age
Ama bro avaru en or use panaru thrla
bro andha anna user kitta vanguna input ku || operator um use panlam and && potukalam bro
mport java.util.Scanner;
class light{
public static void main(String[]args){
Scanner traffic = new Scanner(System.in);
String s= traffic.next();
String s1= "red";
String s2= "yellow";
String s3= "green";
if(s1.equals(s)){
System.out.println("Stop");
}
else if(s2.equals(s)){
System.out.println("Ready");
}
else if(s3.equals(s)){
System.out.println("Go");
}
else{
System.out.println("Invalid input");
}
}
}
What is difference between Devops and full stack developer please answer bro
Bro what is the use of those "s:" and "x:" in the print statements...?
Can anyone tell me
Congratulations for 6 lack subscribers
AI ய பற்றி சொல்லுங்க. இதால IT படிச்சவங்கட வேல பாதிக்கபடுமா?
No
package Exercise_EMC;
import java.util.Scanner;
public class Exercise15 {
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
String color = scan.nextLine();
if(color.equals("red")){
System.out.println("Stop");
} else if(color.equals("yellow")){
System.out.println("Get Ready");
} else {
System.out.print("Go");
}
scan.close();
}
}
q3.
import java.util.Scanner;
class hello{
public static void main(String argd[])
{
Scanner scan = new Scanner(System.in);
String color = scan.nextLine();
if (color.equals("red"))
{
System.out.println("Stop.");
}
else if (color.equals("yellow"))
{
System.out.println("Get Ready.");
}
else if (color.equals("green"))
{
System.out.println("Go.");
}
}
}
Question 4:
import java.util.Scanner;
class Testing7{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter Your Salary:");
int salary = scan.nextInt();
System.out.println("Enter Your Age:");
int age = scan.nextInt();
if(salary>=20000 || age
Completed...
Done the 3program
import java.util.Scanner;
public class traf{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("What the color of the Traffic light:");
String a = scan.nextLine();
String l1 = "Red";
String l2 = "Green";
String l3 = "Yellow";
if(a.equals(l1)){
System.out.println("Stop");
}
else if(a.equals(l2)){
System.out.print("Go");
}
else{
System.out.print("Steady");
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String [] args)
{
Scanner scan=new Scanner(System.in);
String color=scan.nextLine();
if(color.equals("red"))
{
System.out.println("STOP");
}
else if(color.equals("yellow"))
{
System.out.println("READY");
}
else
{
System.out.print("GO");
}
}
}
bro question la 20000 thousand or above eligible but neega 19k podinga elgible varuthu
import java.util.Scanner;
class traffic{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
{
System.out.println("Color");
}
String color = scan.nextLine();
if(color.equals("red"))
{
System.out.print("Stop");
}
if(color.equals("yellow"))
{
System.out.print("Get ready");
}
if(color.equals("green"))
{
System.out.print("Go");
}
}
}
Machine learning pathi oru video poduga bro
Hi Bro i think this is the actual code for Q4:
import java.util.Scanner;
class Salary
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
System.out.println("Enter Your Salary");
int Salary=s.nextInt();
System.out.println("Enter Your age");
int Age=s.nextInt();
if(Salary>=20000&&Age
This has some errors bro...😢
@@Ansh96882 what error bro
Aiml pathi solunga annow
import java.util.Scanner;
class hello{
public static void main(String arg[])
{
Scanner scan = new Scanner(System.in);
String colour = scan.nextLine();
String c1 = new String("red");
String c2 = new String("yellow");
String c3 = new String("green");
if(colour.equals(c1))
{
System.out.print("stop");
}
if(colour.equals(c2))
{
System.out.print("get ready");
}
if(colour.equals(c3))
{
System.out.print("go");
}
}
}
Anna 1st problem ku
(4971)
Ipdiyum kudukalam la
Ila ithu thappa sollunga bro
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String a=sc.next();
if(a.equals("red")){
System.out.print("Stop");
}
else if(a.equals("orange")){
System.out.println("ready");
}
else if(a.equals("green")){
System.out.print("Go");
}
}
}
Code for Question3:
import java.util.Scanner;
public class codechallenge6 {
public static void main(String[] args) {
System.out.println("Enter the Color red/green/yellow
");
Scanner scan =new Scanner(System.in);
String color=scan.nextLine();
if (color.equalsIgnoreCase("red"))
{
System.out.println("Stop");
}
else if(color.equalsIgnoreCase("yellow"))
{
System.out.println("Get Ready");
}
else if(color.equalsIgnoreCase("Green"))
{
System.out.println("Go");
}
else
{
System.out.println("Invalid input");
}
}
}
import java.util.Scanner;
public class Coding_Challenge {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("What is the colour of trafic light?");
String Colour = input.next();
if(Colour.equals("red")) {
System.out.println("Stop");
}
else if(Colour.equals("yellow")) {
System.out.println("Get Ready");
}
else {
System.out.println("Go!!!");
}
}
}
import java.util.Scanner;
public class demo2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String color = sc.nextLine();
if(color.toLowerCase().equals("red")){
System.out.println("Stop");
}
else if(color.toLowerCase().equals("green")){
System.out.println("Go");
}
else if(color.toLowerCase().equals("yellow")){
System.out.println("Get Ready");
}
sc.close();
}
}
import java.util.Scanner;
class q1 {
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter the salary");
int salary = scan.nextInt();
System.out.println("Enter the age");
int age = scan.nextInt();
if (salary>= 20000 || age
import java.util.Scanner;
public class challenge
{
public static void main(String args[])
{
Scanner ps=new Scanner(System.in);
System.out.println("Enter your salary:");
int salary=ps.nextInt();
System.out.println("Enter your age:");
int age=ps.nextInt();
if(salary>=20000||age
Q4 else question la solva illa
bro python coding challenge podunga bro
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int d = scan.nextInt();
int e = scan.nextInt();
int sum = a+b+c+d+e;
int avg = sum/5;
if(avg
bro qn 4 la salary &age requirement meet panalana not eligible nu print aganum thana athan qn ithu doubt bro
♥️
Bro completed the task is this correct ans
import java.lang.System;
import java.util.Scanner;
class one {
public static void main(String[] args) {
Scanner nandha = new Scanner(System.in);
String traffic_light = nandha.nextLine();
if (traffic_light.equals("red")){
System.out.println("Stop");
}
else if(traffic_light.equals("yellow")){
System.out.println("Get Ready");
}
else if(traffic_light.equals("green")){
System.out.println("Go");
}
}
}
Bro... 1st prblm. 50=
No
enna extension bro use pandringa
Bro na 12th leave la irukan nxt wave la full stack developer kathuka poren 1,00,000 kekuranga worth ah bro
Not. Worth
Vendam bro shiksha technology Chennai la intern pannunga or payilagam la course join pannunga
package Exercise_EMC;
import java.util.Scanner;
public class Exercise14 {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int mark1 = scan.nextInt();
int mark2 = scan.nextInt();
int mark3 = scan.nextInt();
int mark4 = scan.nextInt();
int mark5 = scan.nextInt();
int totalmark = mark1 + mark2 + mark3 + mark4 + mark5;
int average = totalmark / 5;
if (average < 35) {
System.out.println("Additional class is required");
} else {
System.out.print("You are good to go");
}
scan.close();
}
}
import java.util.Scanner;
class loan{
public static void main(String args[] )
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter your salary:");
int sal=scan.nextInt();
System.out.println("Enter your age:");
int age=scan.nextInt();
if(sal>=20000 || age=20000)
{
System.out.println("Eligible for loan based on your salary");
}
else
{
System.out.println("Eligible for loan based on your age");
}
System.out.println("Enter your required loan amount");
int loan=scan.nextInt();
if(loan
import java.util.Scanner;
public class loan{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("What is your salary:");
int a = scan.nextInt();
System.out.println("What is your age:");
int b = scan.nextInt();
System.out.print("what is your loan amount:");
int c = scan.nextInt();
if((a>=20000) || (b
import java.io.*;
import java.util.Scanner;
public class ifelseif
{
public static void main (String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter the traffic signal colour");
String r= scan.nextLine();
String y= scan.nextLine();
String g= scan.nextLine();
if((r.equals("red"))||(r.equals("RED"))||(r.equals("Red")))
{
System.out.println("STOP..");
}
if((y.equals("yellow"))||(y.equals("YELLOW"))||(y.equals("Yellow")))
{
System.out.println("GET READY..");
}
if((g.equals("green"))||(g.equals("GREEN"))||(g.equals("Green")))
{
System.out.println("GO..");
}
}
}
Question 3:
import java.util.Scanner;
class QA5{
public static void main(String args[])
{
Scanner scan= new Scanner(System.in);
String traffic=scan.nextLine();
if(traffic.equals("red"))
{
System.out.print("stop");
}
else if(traffic.equals("yellow"))
{
System.out.print("get ready");
}
else if(traffic.equals("green"))
{
System.out.print("go");
}
}
}
Super and thanks bro ❤
import java.util.Scanner;
class traffic{
public static void main(String args[]){
Scanner jeys = new Scanner(System.in);
String light = jeys.nextLine();
if(light.equals("green")){
System.out.print("Go");
}
else if (light.equals("yellow")){
System.out.print("wait");
}
else if(light.equals("red")){
System.out.print("stop");
}
}
}
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
String colour=sc.nextLine();
{
if(colour.equals("red"))
{
System.out.println("stop");
}
else if(colour.equals("yellow"))
{
System.out.println("get ready");
}
else if(colour.equals("green"))
{
System.out.println("go");
}
}
}
}