In this example, we are using for loop to print the hollow square pattern based on the user input. Modified 2 years, . public static void main(String[] args) { In algorithms for matrix multiplication (eg Strassen), why do we say n is equal to the number of rows and not the number of elements in both matrices? System.out.print(" "); Steps to create a hollow triangle star pattern are: Run 2 nested loops, 1st for 'n' times and 2nd for 1 time for the first row, 2nd for 2 times for the second row, and so on till 'n' times. It is also known as the reverse star pattern. Triangle Character Pattern Program in Java. These patterns are created by arranging the stars which are similar to the number patterns in java. This is more or less just a repeat of the existing answers. } n=5. We are working to cover every Single Concept in JavaScript. } Even Odd Program in Javascript. Execute each loop for 'n' number of times, where 'n' is number of rows/columns in the square, i.e. We and our partners use cookies to Store and/or access information on a device. Checking even or odd number. Click the image below to download the image for quick reference. How do I remove a property from a JavaScript object? Manage Settings Algorithm: Start; Create an instance of the Scanner class. }, package com.w3spoint; Our JavaScript tutorials will help you understand the core concepts of modern JavaScript, one step at a time. Guide to Star Patterns in JavaScript. Pyramid Program. These pattern programs will boost your programming skills mainly creates a good command over loops. } Installing a new lighting circuit with the switch in a weird place-- is it correct? The internal loop will run for 1 time in the first iteration of external code, 2 times in the second iteration, and so on and will add the iteration number of the internal loop to the string. This is one of the popular Java pattern program interview question for fresher. In this pattern control, internal loop such as it runs for 'n' times in the 1st iteration of the external loop, 'n - 1' times in the 2nd iteration, and so on. From the above pattern, you can see each row has a series of stars and spaces. Star Pattern in Javascript-2. Difference between Enumeration and Iterator ? Square star pattern in JavaScript. Patterns are one of the common Java pattern programs that are widely used to improve logical thinking and improve flow control knowledge. A number pattern is a series of numbers (integers) that creates a certain pattern or geometrical shape like square, pyramid, triangle, etc by arranging itself in a certain order. This has been a guide to Star Patterns in Java. if (i >= 1 && i <= 5) { Odd Number Pattern Programs in Java. } How is Python best for mobile app development? Here we provide a link to learn 11 different types of star patterns program. Print pyramid patterns of numbers and stars Displaying patterns using javascript nested for loop: var rows=5; for(var i=1;i<=rows;i++) . 35 Star Pattern Programs In Java | Pattern Program. public class Test { System.out.print(" "); This helps you to master looping and conditional statement. Here, the rows variable demonstrates the number of lines that will be printed in one triangle shape of the Hollow Diamond design. "ERROR: column "a" does not exist" when referencing column alias. Agree int number = 7; This program allows the user to enter the number of rows and columns and then it will display the solid rectangle or square pattern using for loop in Java programming language The diamond pattern is a combination of the pyramid and the reverse pyramid number patterns. The consent submitted will only be used for data processing originating from this website. *, package com.w3spoint; 3) Condition at outer loop is true then 1st inner loop runs with the structure for (int j=1;j<=n-i;j++) and prints space . We are going to cover the following patterns. Here we discuss the introduction and different examples along with the sample code. 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 Either the numbers or the stars(*) in this pattern!!! Can I (an EU citizen) live in the US if I marry a US citizen. Let's take a look at what's going on: start sets the x and y coordinates of the first star at (50,50). Note: Keep the following tips while trying star patterns using JavaScript. public static void main(String[] args) { for (int k = 1; k <= number; k++) { System.out.println(); The right pascal star pattern is the right triangle star pattern and the reversed triangle star pattern together. Star Pattern 4: 5. int n = 8; All rights reserved. In this document, first, we will see how to use Java programming to work with Star patterns programs. We have also used the concepts of recursion and iteration to create the star pattern. Star patterns are a common Java pattern program widely used to improve logical thinking and improve flow control knowledge. Example: Row 2 will have 3 Stars. Star Pattern in Javascript. Related. Users can able to use these design patterns for the discussion of object-oriented software design. The given JavaScript program to print the downward triangle star pattern uses a nested for loop. Star Pattern Programs in Java with tutorial and examples on HTML, CSS, JavaScript, XHTML, Java, .Net, PHP, C, C++, Python, JSP, Spring, Bootstrap, jQuery, Interview Questions etc. } Explanation. So it is mandatory to learn the logic behind these star patterns. This can be helpful to improve your logical programming skills and is helpful in game development and other logical application . Step-3: Let's assume variable n (required number of rows), eg. How to save a selection of features, temporary in QGIS? Here is the solution in javascript while loop: Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. JoomShaper. Not the answer you're looking for? It is a series of stars (*) which creates a certain pattern or geometrical shape such as a square, pyramid, triangle, etc. If you have any problems or doubt then please mention in the below comment box. How to check whether a string contains a substring in JavaScript? } } While using this site, you are agree to have read and accept our terms of use, cookie and privacy policy, 2020 - wikimass.com community, or its affiliates. } Step-2: The given pattern can be converted in to the box format like the above. Use it to write a program that reverses its input a line at a time . The following JavaScript program prints a pyramid pattern made up of stars up to the specified 6 lines. This pattern is the same as the previous pattern only difference is that the number increases in this pattern in each and every iteration, while in the last pattern it starts with 1 again from each row. In this program, we will see how to print the rhombus star pattern in java using a do-while loop. Let me explain the above steps with simple points: Step-1: Given pattern. of stars = Stars in Previous Row + 2. Recommended: Please try your approach on {IDE} first, before moving on to the solution. System.out.print("*"); Let's look into the below possible Pattern Programs in Java which includes Number patterns, Star patterns, and Alphabet patterns. Program 3: Print the Rhombus Star Pattern. The star pattern programs in Java is the part of pattern programs in Java, which we discussed earlier. public static void main(String[] args) { } public static void main(String[] args) { } 1) start. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy, Explore 1000+ varieties of Mock tests View more, Special Offer - Java Training (40 Courses, 29 Projects, 4 Quizzes) Learn More, 600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access, Java Training (41 Courses, 29 Projects, 4 Quizzes), JavaScript Training Program (39 Courses, 24 Projects, 4 Quizzes), jQuery Training (8 Courses, 5 Projects), Java Training (40 Courses, 29 Projects, 4 Quizzes), Java Interview Question on Multithreading, Multithreading Interview Questions in Java, Software Development Course - All in One Bundle. } To keep track of this create a variable (called count here) and increase it in every iteration of the internal loop and use this variable as a number for printing. K Shape Alphabet Pattern Program. }, package com.w3spoint; Polymorphism in Java Method Overloading and Overriding, What is the use of a Private Constructors in Java, How does Hashmap works internally in Java, Serialization and Deserialization in Java with Example. Use the above concepts to create a diamond shape. We and our partners use data for Personalised ads and content, ad and content measurement, audience insights and product development. System.out.print("*"); If you would like to change your settings or withdraw consent at any time, the link to do so is in our privacy policy accessible from our home page.. In this article, I have explained the list of all Star (*) pattern programs in java programming language. Affordable solution to train a team and make them project ready. Right Triangle Star Pattern. Star Pattern 1: 3. forSpaces(n - i - 1); Using For Loop. count--; ********* that it has to be printed inside the console and not in the output or HTML window , Heres the code for doing so in JavaScript . The internal loop will run for 'n' number of times which will print starts in a row and a newline at the end of the loop (\n) while the outer loop will run the internal loop for 'n' number of times which will print starts in a columns. The first loop is the outer loop, and the second loop is the inner loop that shows rows and columns, respectively. This channel is primarily useful for Full Stack Web Developer. A good practice of pattern in JavaScript helps improve problem-solving skills and logical thinking. You can use the value of i from the external loop which will increase from 1 to 'n' inside the internal loop as a condition. This pattern is similar to the previous pattern, the only difference is in characters. You might want to explain what is the "star pattern" you're expecting? 1. for (int i = 1; i <= 2 * k - 1; i++) The complete getPatternProps function. In this article, you learned and created 12 different number patterns in javascript. ****** You have already seen star pattern and alphabet pattern programs similar logic is applied here with numbers. How to print star pattern in JavaScript in a very simple manner? } Here is a simple star pattern that we are required to print inside the JavaScript console. About. Word Pattern Programs in Java. The internal loop will run for 'n' number of times which will print starts in a row and a newline at the end of the . You can see in this pattern characters are the same within a row and only changing in the next iteration of the external loop. Note To create a downward triangle star pattern use a nested loop, it is also known as a reverse star pattern. System.out.print(" *"); If you observe the pattern shown above then you can see it is made up of many other smaller structures and spaces. Square Number Pattern Programs in Java. Print star for first and last position in each row and space for other positions. System.out.print("*"); Line 3: We have the first for loop that will iterate over the total number of rows (5, in the example above). It's very simple, Try this code as below: As I understand from your code, you are actually trying to print stair pattern rather than star. System.out.println(); Learn more, Print Pyramid Star Pattern in Java Program, Java Program to Print Pyramid Star Pattern, Java Program to Print Diamond Star Pattern, Java Program to Print Square Star Pattern, Java Program to Print Inverted Star Pattern, Swift program to Print Pyramid Star Pattern, Swift Program to Print Inverted Star Pattern, Swift program to Print Diamond Star Pattern, Swift program to Print Sandglass Star Pattern, Golang Program To Print Diamond Star Pattern, Golang Program To Print Square Star Pattern. } else { . Visit other pattern programs from the links below. Find centralized, trusted content and collaborate around the technologies you use most. Diamond Pattern in Java. We will deal with 25 different types of Java Pattern Programs through . Star pattern programs in Python using for loop | Here, we will develop a python program to print star patterns. var functionName = function() {} vs function functionName() {}, JavaScript closure inside loops simple practical example. for (int k = 1; k <= i; k++) { System.out.println(""); *, package com.w3spoint; ****** Program to print number with star pattern. To create a square star pattern run 2 nested for loops. Being in an agile software development role, delivering business requirements by taking part in business calls and breaking them into software features and user stories. Declare variables to store the number of rows and the pattern symbol. int number = 5; There are nested loops to iterate rows and columns and print the diamond star pattern. for (int i = 0; i < number; i++) { These programs are commonly asked in core java written interviews for freshers. System.out.print(" "); 7621. But you can use any java programming language compiler as per your availability. System.out.print("*"); could you write how the required output looks? Now use the initialization variable of the internal loop for character increment. if(typeof ez_ad_units!='undefined'){ez_ad_units.push([[300,250],'tutorialstonight_com-medrectangle-4','ezslot_2',624,'0','0'])};__ez_fad_position('div-gpt-ad-tutorialstonight_com-medrectangle-4-0');The pattern shown above is a triangle-shaped pattern using numbers. 2) declare variable n. 3 . Left Triangle Star Pattern. While learning programming concepts Star pattern is used to test different programming skills like looping, conditional statements, etc. ****** **** *** ****** !Like tht of a pyramind.. for (int j = 0; j < number; j++) { LWC Receives error [Cannot read properties of undefined (reading 'Name')]. This article is created to cover a lot of pattern programs using star (*) in Java. if (j == 0 || j == 6) { These orders are defined by programs that you have to generate as a programming skill. for (int j = 1; j <= val - i; j++) { Connect and share knowledge within a single location that is structured and easy to search. You can alsogo through our other suggested articles to learn more . }, * C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept. if(typeof ez_ad_units!='undefined'){ez_ad_units.push([[580,400],'learnprogramo_com-large-mobile-banner-1','ezslot_9',144,'0','0'])};__ez_fad_position('div-gpt-ad-learnprogramo_com-large-mobile-banner-1-0');So this is the pattern program in java which are widely used in java and interviews. public static void main(String[] args) { Pascal's Triangle Pattern Programs in Java. The code is shown below: Create a variable to store the string and assign it with an empty string, Create a for loop to run for 'n' number of times, where 'n' is number of rows/columns in the square, i.e, Inside the loop, create a for loop that prints a star (*) at the beginning and end of the line and space in between, Also, keep in mind that the first and last row should have only stars, Run 2 nested loops, 1st for 'n' times and 2nd for 1 time for the first row, 2nd for 2 times for the second row, and so on till 'n' times, Print star for first and last position in each row and space for other positions, In the last line print star at each position, Run 2 nested loops, 1st for 'n' times and there are 2 internal loops one to print the first series of spaces and the other to print star and space series, Print star for first and last position in each row and space in between, The print star at each position in the last row. Introduction. ********, package com.w3spoint; In our example, add 1+2+3+4+5+6+7+8+9 = 45, then divide by 3. rev2023.1.18.43170. Here we have discussed 10 different number patterns with their programs in detail. The box format is repersented in Rows (1,2,3,4,5) and Columns (1,2,3,4,5). } if (i == 0 || i == 6) { ******** *********, package com.w3spoint; Use the above concepts to create a diamond shape. Each pattern has a name and when discussing complicated design alternatives becomes a component of a . We can also consider this as the height of the pyramid. In the given post, you will learn JavaScript programming code to print the star pattern. public static void main(String[] args) { We will use the For Loop to display star patterns. if (i != number - 1) { An example of data being processed may be a unique identifier stored in a cookie. Add details and clarify the problem by editing this post. acknowledge that you have read and understood our, Data Structure & Algorithm Classes (Live), Full Stack Development with React & Node JS (Live), Data Structure & Algorithm-Self Paced(C++/JAVA), Full Stack Development with React & Node JS(Live), GATE CS Original Papers and Official Keys, ISRO CS Original Papers and Official Keys, ISRO CS Syllabus for Scientist/Engineer Exam, Program to print number with star pattern, Program to print hollow pyramid, diamond pattern and their modifications, Program to print numbers with diamond pattern, Program to print solid and hollow square patterns, Program to print solid and hollow rhombus patterns, Program to print mirror image of Swastika Pattern, Program for triangular pattern (mirror image around 0), Program for triangular patterns of alphabets, Programs for printing pyramid patterns in Python. 1) Begin. Star patterns are a common Java pattern program widely used to improve logical thinking and improve flow control knowledge. **** ****** ***** **** By using this website, you agree with our Cookies Policy. for (int i = 1; i <= count; i++) for (int row = 8; row >= 1; --row) { private static void forStars(int count) { To create a square star pattern run 2 nested for loop. What does "use strict" do in JavaScript, and what is the reasoning behind it? It uses 2 loops inside the external loop one for printing spaces and the other to print the star. Every interview starts with pattern programs. } To get this set initialization variable j less than 'n - i + 1'. To view the purposes they believe they have legitimate interest for, or to object to this data processing use the vendor list link below. ***** Program to print 8 star pattern in c; Through this tutorial, we will learn how to print 8 star pattern using for loop and while loop in c programs. ***** System.out.println(); 1) Read n value using scanner object and store it in the variable n. 2) Run the outer for loop with the structure for (int i=1;i<=n;i++) to iterate through rows, run the inner loops to iterate through columns. School Guide: Roadmap For School Students, Program to print half diamond Number-Star pattern, Program to print half Diamond star pattern, Print the Alphabets A to Z in Star Pattern, Printing triangle star pattern using a single loop, Program to print hollow rectangle or square star patterns. package com.w3spoint; I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS . ** ** System.out.print("*"); } *** *** Row 3 will have 5 stars and so on. With the help of these patterns, the unexperienced developers could learn the software design in an easy and faster way. System.out.println(); Here is the code for the right pascal star pattern. Some shapes of star patterns are given. 6029. You can observe in the above pattern it is nothing but the right triangle star pattern and reversed triangle star pattern together. Node.js Pattern. for (int row = 1; row <= 8; ++row) { ** ALL RIGHTS RESERVED. ***** The left pascal star pattern is also created using 2 nested loops. Here the row demonstrates a number of lines that will be printed in the reverse triangle shape. wikimass.com is a community website, which is optimized for learning, discussing and testing the concept in depth, each comments by user will be reviewed by our authority after publishing it live to maintain our community standard, we constantly review all our tutorials to give user up-to-date information and to avoid errors, but we cannot warrent full correctness of all contents published under wikimass.com. 7256. ******* ******* ********** *********. Want to improve this question? How do I include a JavaScript file in another JavaScript file? Use <br> tag to insert new line. Star patterns is a series of * used to create some pattern or any geometrical shape. You need to use two loops or three loops (depending on the programs) to show Star patterns in Java Programming. Continue with Recommended Cookies. The external loop will execute internal loops for 'n' number of times and the internal loop will design a pattern for each row. *** A hollow diamond pattern is a simple diamond shape that has only a boundary that is made up of stars. Hourglass pattern is a combination of the reverse pyramid and pyramid number patterns. pyramid, right triangle, pascal pattern, diamond pattern, sandglass, K shape, H shape, etc. Reply. int number = 7; The given JavaScript programme generates the right triangle star by nesting two for loops, with the external loop handling pattern columns and the internal loop handling pattern rows. By signing up, you agree to our Terms of Use and Privacy Policy. System.out.println(); In this article, we have discussed the star pattern in JavaScript. Observe in the above pattern it is a reverse pyramid and a pyramid together. Star patterns can be created in any programming language, however here we are going to use JavaScript. This can be helpful to improve your logical programming skills and is helpful in game development and other logical application development. For origins not covered by the patterns specified here, the global. The given JavaScript diamond star pattern program example uses two sets of loops to print the upper and lower portions of a diamond. Odd number pattern programs in Java. { pascal & # x27 ; s assume variable n ( required of... The part of pattern programs in Java. below to download the image below to download image. Might want to explain what is the code for the discussion of object-oriented design. Concepts star pattern uses a nested for loops. have discussed 10 number... Lot of pattern in JavaScript helps improve problem-solving skills and logical thinking and improve flow knowledge! Nested loops to iterate rows and columns ( 1,2,3,4,5 ) and columns and print the upper and lower portions a... Discuss the introduction and different examples along with the sample code ; here the... Similar to the number of rows ), eg rhombus star pattern i ( an EU citizen ) live the... I < = 5 ) { } vs function functionName ( ) { pascal #. Image for quick reference 2 loops inside the external loop one for printing spaces and the pattern symbol property! Alternatives becomes a component of a these pattern programs similar logic is applied javascript star pattern programs. The help of these patterns, the rows variable demonstrates the number of lines that will be in. Simple points: Step-1: given pattern can be helpful to improve logical and. Get this set initialization variable of the popular Java pattern program widely used to improve your logical programming skills is... Features, temporary in QGIS required output looks triangle shape, package com.w3spoint ; JavaScript! And conditional statement ( ) { Odd number pattern programs in detail Concept in JavaScript helps improve problem-solving and... Line at a time two loops or three loops ( depending on the user input, and the loop. Javascript console also created using 2 nested loops to iterate rows and columns and print the diamond pattern. Is similar to the box format like the above concepts to create the pattern! The Scanner class find centralized, trusted content and collaborate around the technologies you most. '' ) ; in this pattern characters are the same within a row and changing... Loops, Arrays, OOPS Concept Keep the following JavaScript program prints a pyramid pattern made up stars! A link to learn the software design step at a time '' do in JavaScript. write a that... Get this set initialization variable j less than ' n - i 1. Demonstrates a number of lines that will be printed in the given JavaScript diamond star pattern programs are! The stars which are similar to the specified 6 lines int number = 5 ) }. * used to create a downward triangle star pattern together pattern 4: 5. int n 8! Write a program that reverses its input a line at a time very simple manner? simple diamond.! We will deal with 25 different types of star patterns is a of... Points: Step-1: given pattern can be converted in to the box format the... If ( i > = 1 ; i++ ) the complete getPatternProps function uses two of. Patterns are a common Java pattern programs using star ( * ) Java! Our other suggested articles to learn more as a reverse pyramid and a pyramid pattern up! Their programs in javascript star pattern programs. within a row and space for other positions i = 1 & i! An instance of the popular Java pattern program interview question for fresher the user input good practice of pattern Java! Of stars variable of the pyramid is similar to the Previous pattern, diamond pattern, sandglass k. Int i = 1 ; i++ ) the complete getPatternProps function learned and created 12 number... Pattern it is mandatory to learn 11 different types of Java pattern programs that are widely used create! { System.out.print ( `` `` ) ; here is the code for the right star... Has been a guide to star patterns in Java. good command over loops. rows variable the! Logo 2023 Stack Exchange Inc ; user contributions licensed under CC BY-SA # programming, conditional,... Be converted in to the number patterns in Java. information on a device one of pyramid... Star for first and last position in each row and space for other positions by signing,. Within a row and space for other positions, * C #,! Concepts of modern JavaScript, one step at a time is nothing but the right triangle, pascal,. And reversed triangle star pattern and product development article is created to cover every Concept..., first, we have discussed the star pattern programs similar logic is applied with... ) in Java using a do-while loop a link to learn 11 different of. Above steps with simple points: Step-1: given pattern patterns with programs! You have already seen star pattern that we are going to use JavaScript }... Tag to insert new line changing in the below comment box the box format is repersented rows. Class Test { System.out.print ( `` * '' ) ; here is a simple diamond shape consider this the. Is repersented in rows ( 1,2,3,4,5 ) and columns, respectively ; There are nested loops iterate! ; tag to insert new line and created 12 different number patterns in helps... Public class Test { System.out.print ( `` * '' ) ; could you how! With the help of these patterns, the global can also consider this as the reverse triangle of. Learn JavaScript programming code to print the hollow diamond design rhombus star pattern using 2 nested to. Then please mention in the given JavaScript program to print the hollow square pattern based on the input! Pyramid and a pyramid pattern made up of stars = stars in Previous +! Right pascal star pattern skills mainly creates a good practice of pattern in Java programming to work with patterns... Have already seen star pattern ( an EU citizen ) live in the comment... Portions of a diamond a link to learn 11 different types of star patterns step-3: Let & # ;. Logical thinking and improve flow control knowledge from a JavaScript file in another JavaScript file than ' -! Some pattern or any geometrical shape and Privacy Policy star for first and last position in row... Is made up of stars = stars in Previous row + 2 loop | here, the rows variable the. Thinking and improve flow control knowledge i include a JavaScript file program interview question for fresher a substring in,... Steps with simple points: Step-1: given pattern can be helpful to improve thinking! To train a team and make them project ready * the left pascal star and. `` ) ; here is the part of pattern programs using star ( ). Patterns are created by arranging the stars which are similar to the box format the... Of All star ( * ) in Java programming to work with star patterns is a series *! Clarify the problem by editing this post the reverse pyramid and pyramid number patterns in Java using a loop... Are similar to the box format is repersented in rows ( 1,2,3,4,5 ). two loops or three (. Based on the programs ) to show star patterns pattern programs using javascript star pattern programs *... Me explain the above concepts to create a square star pattern uses a nested loops... The diamond star pattern programs that are widely used to improve your logical skills! Pattern characters are the same within a row and space for other.. * '' ) ; using for loop is a series of * used to improve logical thinking Settings:. Trusted content and collaborate around the technologies you use most alphabet pattern programs using star *... Package com.w3spoint ; our JavaScript tutorials will help you understand the core concepts of recursion and to! Javascript? and clarify the problem by editing this post existing answers. only... Of lines that will be printed in one triangle shape of the external loop one for printing spaces the. On to the number patterns in Java is the part of pattern programs Java! Stack Web Developer and product development boundary that is made up of stars and.! Up to the solution could learn the logic behind these star patterns using.... Error: column `` a '' does not exist '' when referencing column alias loops. int i = ;. The list of All star ( * ) pattern programs in Java programming language compiler as per your.... Information on a device Odd number pattern programs will boost your programming skills like looping, conditional statements etc... Discussed earlier by editing this post second loop is the part of pattern Java. K - 1 ; i++ ) the complete getPatternProps function pattern symbol rows ( 1,2,3,4,5 ). 11. On to the javascript star pattern programs pattern, you will learn JavaScript programming code to print the and! ; ++row ) { Odd number pattern programs in Java, which we discussed earlier control knowledge unexperienced... Helps you to master looping and conditional statement j less than ' n - i - )... Program example uses two sets of loops to iterate rows and the second loop is the solution JavaScript... Sandglass, k shape, H shape, etc comment box using 2 loops! The upper and lower portions of a steps with simple points: Step-1: given pattern be! A diamond shape that has only a boundary that is made up of stars to! Originating from this website be used for data processing originating from this website ad... = 2 * k - 1 ) ; this helps you to master looping and conditional statement for. Looping and conditional statement two loops or three loops ( depending on the user input going to use Java to!