Day 22 of Programming – String Problems Today I practiced some basic but important String-based problems that help strengthen logic building and text processing skills. 🔹 Topics Covered: • Count Vowels in a String • Count Consonants in a String • Count Words in a Sentence 💡 1️⃣ Count Vowels Vowels in English are: a, e, i, o, u Example: Input: programming Output: Vowels = 3 Logic: Traverse through the string and check if each character is a vowel. 💡 2️⃣ Count Consonants Consonants are all letters except vowels. Example: Input: programming Output: Consonants = 8 Logic: Check if the character is an alphabet but not a vowel. 💡 3️⃣ Count Words in a Sentence This problem helps in understanding string traversal and space detection. Example: Input: "Java is very powerful" Output: Words = 4 Logic: Count the number of spaces and add 1 to get the total number of words. #Java #Programming #Strings #CodingJourney #LearningToCode #Developers
Counting Vowels Consonants Words in Strings with Java
More Relevant Posts
-
Day 21 of Programming – Strings in Java Today I explored some important String operations that are commonly used in programming and coding interviews. 🔹 Topics Covered: • Reverse a String • Check whether a String is a Palindrome • Count / Check Spaces in a String 💡 1️⃣ Reverse a String Reversing a string means printing the characters in the opposite order. Example: Input: hello Output: olleh This helps in understanding loops and string indexing. 💡 2️⃣ Palindrome String A palindrome is a word that reads the same forward and backward. Examples: madam, level, racecar Logic: Reverse the string and compare it with the original string. 💡 3️⃣ Checking Spaces in a String Sometimes we need to count how many spaces are present in a sentence. Example: Input: "Java is fun" Spaces Count = 2 This helps in text processing and validation tasks. #Java #Programming #Strings #CodingJourney #LearningToCode #Developers #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Operators in Java — and this is where coding actually starts feeling real 👇 Instead of just theory, I tried solving small problems using operators. 💡 Example 1: Even or Odd int num = 7; System.out.println(num % 2 == 0 ? "Even" : "Odd"); 💡 Example 2: Find largest number int a = 10, b = 5; int max = (a > b) ? a : b; System.out.println("Max: " + max); 💡 Example 3: Using increment int count = 1; count++; System.out.println(count); // 2 👉 What I learned today: Arithmetic → for calculations Relational → for comparisons Logical → for combining conditions Unary → for quick updates (++/--) Ternary → for writing clean if-else Understanding operators made me realize how logic is built step by step in programming. #Java #CodingJourney #LearnJava #FullStackDeveloper
To view or add a comment, sign in
-
Read a sensor value. Save it to a database. In Python that's 4 lines. Java: 12. C#: 8. Go: 6. Each looks completely different. Each needs a developer who knows that specific stack. Developer leaves? New one prefers something else. Rewrite. The logic never changed. But the implementation is tied to whoever wrote it. That's what visual development actually solves. Not "easier." Independent. #SoftwareArchitecture #NoCode #Manufacturing
To view or add a comment, sign in
-
-
C++, Python, and Java are three of the most popular and influential programming languages, each serving different purposes and having distinct characteristics regarding performance, ease of use, and platform independence. C++ is a powerful, high-performance, compiled language that offers low-level memory management and hardware
Senior Telecom Business Leader | Delivering Excellence in MEA Markets Sales | Operator Partnerships • Revenue Growth • Strategic Deals 🚀
💻 Programming Languages: Complexity vs Productivity Some developers spend hours managing memory, dependencies, and configurations. Others simply write: print("DONE") ☕ This doesn’t mean one language is better than another. Each language was built for a different purpose and philosophy. 🔹 C++ Maximum control and performance 🔹 Java Structured, enterprise-grade development 🔹 Python Simplicity, speed, and productivity The real lesson? 👉 Great engineers choose the right tool for the problem not the one with the most complexity. Sometimes the smartest solution is also the simplest one. #Programming #SoftwareDevelopment #Python #Java #CPP #Coding #TechHumor #DeveloperLife
To view or add a comment, sign in
-
-
🚀 Starting my journey in Java programming! Today I implemented a simple concept with a Program— Factorial of a number. Factorial is widely used in mathematics and programming problems. Through this program, I practiced loops, condition handling, and method creation in Java. 💡 What I learned: • Writing reusable methods • Handling edge cases (like negative numbers) • Taking user input using Scanner • Strengthening my logic-building skills Here’s my implementation: import java.util.*; class FactorialProgram { private static int factorial(int a) { int fact = 1; if (a >= 0) { for (int i = a; i >= 1; i--) { fact = fact * i; } } else { System.out.println("Factorial of negative numbers cannot be determined"); return 0; } return fact; } public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.print("Enter the number: "); int a = sc.nextInt(); System.out.println("\nFactorial of the Number: " + factorial(a)); sc.close(); } } Would love feedback or suggestions to improve this further 🙌, as i am learning please help!! #Java #Programming #CodingJourney #LearningInPublic #BeginnerDeveloper #TechSkills
To view or add a comment, sign in
-
Programming languages are just tools. But the way we use them makes all the difference. ⚙️ 🔹 C — Simple, but you better be careful 🔹 Java — Structured, reliable, enterprise-ready 🔹 JavaScript — Flexible… sometimes too flexible 😅 🔹 C++ — Powerful, but can get messy fast 🔹 Python — Simple, yet dangerously powerful 🚀 Here’s the truth most beginners miss: 👉 No language is “best” 👉 Every language is optimized for a problem space The real skill is not *learning more languages*… It’s knowing **when to use which tool**. Because in real-world engineering: ✔️ Clarity beats complexity ✔️ Maintainability beats cleverness ✔️ Problem-solving beats syntax Focus less on *which language is trending* Focus more on *what problem you’re solving*. That’s how great developers think. 💡 #Programming #SoftwareDevelopment #Coding #Python #JavaScript #Java #Cpp #DeveloperMindset #TechCareers
To view or add a comment, sign in
-
-
Reversed String in Java | Easy Logic + Coding 💡 Strong fundamentals are essential to become a confident developer. This example shows how String Reversal works using simple logic: • Start with a given string • Traverse the string from last character to first • Use loop or built-in methods • Form the reversed string Practicing these types of problems improves logical thinking and strengthens coding basics. 📊 Example Input : LIVE Output : EVIL 🎥 I’ve also created a short video explaining this concept with code: YouTube link : https://lnkd.in/eKH2JJwa #Java #Programming #ProblemSolving #Coding #SoftwareDevelopment #Learning #CSE #Developers #LogicBuilding #String
To view or add a comment, sign in
-
-
Day 32-What I Learned In a Day(JAVA) Today, I dedicated my time to practicing Pattern Programming in Java, and it turned out to be a very valuable learning experience. Pattern programming is not just about printing shapes using stars or numbers - it actually helps in building a strong foundation in logic development. While working on different patterns, I understood how important nested loops (for loops inside another loop) are and how they control the flow of rows and columns in a program. I explored different types of patterns such as: • Square patterns • Triangular patterns • Pyramid structures One key learning: Every pattern can be broken down into: Rows (outer loop) Columns (inner loop) Condition (when to print star or space) By identifying these three parts, even complex patterns become easy to solve. In total, I solved 16 pattern problems today, which boosted my confidence in coding and strengthened my core Java concepts. Consistency in small steps like this is what builds strong programming skills over time. Practiced 👇 #Java #PatternProgramming #CodingJourney #ProblemSolving #Learning #Developers #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 29 – Solving Logic-Based Problems Using Loops in Java Today’s focus was on applying loop concepts to solve practical problems using do-while and for loops in Java. Instead of just learning syntax, I worked on implementing real-world logic through coding challenges. 📚 Problems Solved ✔ Password Checker (do-while loop) Built a program that keeps asking for input until the correct password is entered, ensuring at least one execution using the do-while loop. ✔ Number Guessing Game (do-while loop) Implemented a simple game where the program continues to run until the user guesses the correct number. ✔ Multiplication Table (for loop) Used a for loop to generate the multiplication table for a given number in a structured format. 💻 Concepts Practiced • Using do-while loop for repeated execution with guaranteed first run • Building interactive programs with user input • Applying for loop for fixed iterations • Strengthening logic building and control flow 💡 Key Learning Loops are fundamental for building interactive and dynamic programs. Understanding when to use do-while vs for loop helps in writing efficient and clean logic for different problem scenarios. #Java #CoreJava #JavaProgramming #Loops #ProblemSolving #Programming #SoftwareDevelopment #CodingPractice #DeveloperSkills 🚀
To view or add a comment, sign in
-
-
Today I explored some fundamental yet powerful concepts in Java that every developer should have a strong grip on: 🔹 Static Methods & VariablesUnderstanding how static members are shared across all objects really changed how I think about memory and efficiency. It’s amazing how a simple static keyword can help track object creation and maintain shared data seamlessly. 🔹 Constructor Overloading & this KeywordThis concept made object initialization much more flexible. Using multiple constructors and the this keyword not only improves code readability but also avoids redundancy. 💡 What I realized:Strong basics are the real game-changer. These concepts might look simple, but they build the foundation for writing clean, scalable, and efficient code. 📌 Consistency in learning > Complexity in topics I’m currently focusing on strengthening my core Java skills and building projects around them. Every small concept learned today contributes to becoming a better developer tomorrow. #Java #Programming #CodingJourney #DeveloperLife #JavaDeveloper #Learning #TechSkills #Coding #StudentDeveloper
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development