Mauwanna0327
Eternal Poster
- Joined
- Jul 20, 2017
- Posts
- 773
- Reaction
- 114
- Points
- 269
Hirap po ng codes namin sa java di pa natuturo
Thanks broTingin ka po ng mga tutorials sa yôutubê, mag start ka muna sa mga basics like variable, class, if, if else, switch, for loop, while loop, do while loop. Mas maganda iintindihan mabuti kung ano ang functions ng mga nabanggit ko, pag nalaman mo na yan logic na lng ang kailangan mo para ma solve yang problem mo.
Ang need nya basics knowledge about sa programming. Sa stock overflow need mo basics knowledge para maintindihan yung mga contents na naroon. Sa case ni ts mukang wala pa siyang alam sa basics knowledge or oop concept.sa stock overflow madaming tutorials
package com.example;
import java.util.Scanner;
class TwoStrings{
public static void main(String []args) {
Scanner scanner = new Scanner(System.in); //Pang 'scan' ng user input
String s1,s2;
String yourname = "John Doe";
System.out.println("Enter a string: ");
s1 = scanner.next();
if(s1.length()>=1 || s1.length()<=5){
System.out.println("Enter another string: ");
s2 = scanner.next();
if(s1.equals(s2)){
System.out.println(yourname);
}
else {
if(s1.contains("a")){
s1 = s1.replace("a","x");
//System.out.println(s1);
}
}
}
}
}
Nice paps, keep sharing.Code:package com.example; import java.util.Scanner; class TwoStrings{ public static void main(String []args) { Scanner scanner = new Scanner(System.in); //Pang 'scan' ng user input String s1,s2; String yourname = "John Doe"; System.out.println("Enter a string: "); s1 = scanner.next(); if(s1.length()>=1 || s1.length()<=5){ System.out.println("Enter another string: "); s2 = scanner.next(); if(s1.equals(s2)){ System.out.println(yourname); } else { if(s1.contains("a")){ s1 = s1.replace("a","x"); //System.out.println(s1); } } } } }
Java basic introduction tut:
- You do not have permission to view the full content of this post. Log in or register now.
More info:
- Strings: You do not have permission to view the full content of this post. Log in or register now.
- Scanner: You do not have permission to view the full content of this post. Log in or register now.
Try nyo po mag practice dito:
- You do not have permission to view the full content of this post. Log in or register now.
Wala naman masamang humingi ng tulong basta mag initiate ka muna i search sa google/YøùTùbé yung problems mo then kung hindi mo maintindihan saka ka humingi ng tulong. Sa mundo ng programming, basics lng ang tinuturo sa school almost 30% lng at guide lng sila, ang 70℅ ay puro self studying na. Kaya mas mabuti paps kung nag a-advance study ka na sa mga subjects mo.Thanks dito paps sana last time ko na itong humingi ng tulong para di spoon feed. Samalat ulit