Postingan

Menampilkan postingan dengan label programming

Program C++ Menghitung Nilai Akhir dan Grade (A, A-, B+, B, B-, C+, C, C-, D+, D) Terbaru

Gambar
Hai sobat blog excation, saya akan membagikan source code program C++ yang bisa di gunakan untuk Menghitung Nilai Akhir dan Grade (A, A-, B+, B, B-, C+, C, C-, D+, D) dll. Admin udah cari keliling gugel tapi ngak dapat-dapat akhirnya admin berusaha membuat program ini dengan logika seadanya, silahkan di lihat codenya. SOURCE CODE : #include <iostream.h> #include <conio.h> #include <stdio.h> main() { int nik,niq,nit,nts,niu,na,nikm,niqm,nitm,ntsm,nium; cout<<"Program Hitung Nilai Akhir dan di kerjakan dengan susah payah oleh admin zhasuzer www.excation.info\n"; cout<<"\n\tNilai Kehadiran = ";cin>>nik; cout<<"\n\tNilai quis = ";cin>>niq; cout<<"\n\tNilai tugas = ";cin>>nit; cout<<"\n\tNilai UTS = ";cin>>nts; cout<<"\n\tNilai UAS = :";cin>>niu; nikm=nik*10/100; niqm=niq*15/100; nitm=nit*15/100; ntsm=nts*25/100; nium=niu*35/100; na=nikm+niqm

What is the real use of Method Overloading in Java or Programming?

Many programmers, including Java and C++, knows about overloading e.g. method overloading or function overloading, but if you ask them why you should overload a method? Many of them become clueless. This is a common problem of half learning i.e. you know the concept but you don't know the application. If you neither know what problem it solves nor what benefit it provides, then just knowing the concept is not good enough. You won't be able to reap all benefit if you just know the concept and never use it in practice. The most important benefit overloading provides is a cleaner and intuitive API. Read more �

10 Programming Tips to Create Maintainable Java Applications

Hello all, today is 31st December, the last day of 2016 and this is probably the last post on Javarevisited for this year and I want to make it special. That's why I am going to share you some tips on creating maintainable Java applications which will help you not just in the new year, but also in all the coming years in your software development career. One aspect of development, which is often overlooked by developers is to create applications which are both easy to maintain and support . Since a software spends 90% of its lifetime in maintenance mode, it's very important that your application is easy to configure, support, and maintain. Also, Java application is no different than any other software, you must pay attention to these key properties of writing production quality code, hence this tips also applies to any programming language which is used to create real-world software which is used by real users. Read more �

Spring Hello World Example using XML Config

In this Spring framework tutorial, you will learn how to write the hello world example in Spring framework. This should be the first tutorial to start learning Spring framework, as it gets the ball rolling. While coding and running this example, you learn a lot about Spring framework, Spring XSD files, necessary JAR files, and more importantly how Spring framework works.This HelloWorld program in Spring framework is an extension of classic a l Java hello world program , w ritten usin g dependency Injection design pattern by using Spring Fram ework's IOC container. Even though now you can configure Spring dependency using annotations and Java configuration, this example uses traditional XML way to configure dependency. Read more �

5 Software Development and Project Management Books - Best of Lot, Must Read

Some of you might ask, Why software project manager should read books? Isn't they are experienced enough to become a project manager and handle software development? A genuine question but Software management is harder than any other management purely because every software is different than the previous one. Many other streams of engineering e.g. Civil or Mechanical got better in terms of estimation and management with the help of software but software development is still run on experience. Read more �

Why use Spaces over Tabs for Indentation in Code Editors - Eclipse

When I started coding in Eclipse, I was not aware that by default Eclipse uses tabs for indentation and tabs can have varied with e.g. 1 tab can be equal to 2 spaces or 4 spaces or even 8 spaces. Sometimes, It's all up to you how you configure tabs in your code editor and other times just the mercy of the tool you don't know how to configure e.g. VI in UNIX. I only realize the problem when I found too many difference in a file while check-in into SVN. Apparently, other people was using different indentation (spaces) and that's why the file was showing so many differences when I reformatted them in Eclipse. This happens to many programmers, some pay attention, some didn't and go ahead with the check-in the code, only to revert it back later. There is no clear guideline upon which one is better and whether a programmer should use tabs or spaces, even the Clean Code doesn't help here. Read more �

Mengenal Tipe Data pada MySQL

Mengenal Tipe Data MySQL - Tipe Data didalam Database MySQL adalah query untuk mendefinisikan kolom pada tabel. dimana ketika kita membuat kolom didalam suatu tabel kita harus melalukan mengenalan kolom kepada MySQL apakah kolom itu berbentuk data unik, karakter, nomor, kriteria karakter serta campuran antara nomor dan huruf (karakter). Tipe Data didalam Database MySQL juga sangat banyak jenisnya, namun pada artikel ini yang saya jelaskan hanya sebagian sebagai bahan untuk referensi penggunaan PHP/MySQL nantinya. Tipe Data MySQL Tipe Data Integer Integer adalah tipe data yang digunakan untuk mengenalkan angka bulat pada MySQL.penggunaanya biasanya menggunakan penulisan nama_kolom int (20); int (20) artinya jumlah angka maksimal 20. Tipe Data Char dan Varchar Tipe data ini yang paling sering digunakan pada saat membuat kolom pada tabel MySQL. Perbedaan antara CHAR dan VARCHAR adalah dari cara MySQL melokasikan ukuran penyimpanan data pada MySQL yang dimasukkan kedalam kolom tersebut. na

Top 5 Books for Programming/Coding Interviews - Best of lot

If you are preparing for Programming Job interviews and looking for some of the best books for programming questions then you have come to the right place. In this article, I am going to share a couple of good books to prepare coding, software design, and data structure algorithm questions, which are essential for any coding interviews. Though a programming interview also explores other areas of software development e.g. the programming language you would be mainly using in your project e.g. C++ or Java. The database and SQL based questions, the operating systems and UNIX related questions, some of the software design and object oriented design pattern questions and much more, but coding based questions forms the core of programming interviews. Read more �

Top 10 Google Interview Questions for Software Engineer - Books, Resources

These Google interview questions are some of my favorites collected from different sources. Every Programmer knows that Google is one of the best technology company and its dream for many software developers to work for google, but at same time interview process at google is very tough and only a few genuine intelligent programmers get through their interview process . Google interview questions have always been a good topic of discussion when few young software developer gathered around, I can still remember when one of my friends got a call from google for an interview then how the whole bunch was got excited. We have searched a lot on the internet on google interview questions and answers for him and us and then make a note of some of the best questions for preparation. I am listing down some google interview questions from that list. Read more �

Difference between Stack and Heap memory in Java

The difference between stack and heap memory is c ommo n programming question a sked by beginners learning Java or any other programming language. Stack and heap memory are two terms programmers starts hearing once they started programming but without any clear and definite explanation. Lack of knowledge of what is a heap in Java an d what is stack memory in Java results in misconceptions related to stack and heap. To add to this confusion, a stack is also a data structure which is used to store elements in LIFO(Last In First out) order and available in Java API as java.util.Stack . In general, both stack and heap are part of memory, a program is allocated and used for different purposes. Java program runs on JVM which is launched as a process by "java" command. Java also uses both stack and heap memory for different n eeds. In our last article 10 points on Java heap space , I h ave touched base on Java heap space and in this article we will see the difference between s

JUnit 4 Tutorial - Test Exception thrown by Java Method with Example

One part of unit testing a Java method is checking exception thrown by that method. A Java unit test should verify correct exception thrown in exceptional case and no exception should be thrown in normal case. In JUnit 3.XX , there was no direct support to pass or fail a test based upon exception thrown by a Java method. JUnit4 address this issue and provides an easy, and readable way to te st exception thrown by a Java method. There are many situations when you need to test exception thrown by any method in Java . Classical example of this is testing API methods which should throw Il legalArgumentException if arguments passed to method are not matching to pre-conditions. In order to test exception thrown by any method in JUnit 4 you need to use @Test(expected=IllegalArgumentException.class) annotation. You can replace IllegalArgumentException.class with any other exception e.g. NullPointerException.class or ArithmeticException.class etc. Read more �

10 Exception handling Best Practices in Java Programming

Exception handling is an important part of writing robust Java application. It�s a non functional requirement for any application, to gracefully handle any erroneous condition like resource not available, invalid input, null input and so on. Java provides several exception handling features, in built in language itself in form of try , catch an d finally keyword . Java programming language also allows you to create new exceptions and throw them using throw and throws k eyword. In reality, Exception handling is more than knowing syntax. Writing a robust code is an art more than science, and here we will discuss few Java best practices related to Exception handling. Th ese Java best practices are f ollowed even in standard JDK libraries, and several open source code to better deal with Errors and Exceptions. This also comes as handy guide of writing robust code for Java programmers. Read more �

How to check if two String are Anagram in Java - Program Example

Write a Java program to check if two String are anagram of each other, is another good coding question asked at fresher level Java Interviews. This question is on similar level of finding middle element of LinkedList in one pass and swapping two numbers without using temp variable . By the way two String are called anagram, if they contains same characters but on different order e.g. army and mary , stop and pots etc. Anagrams are actually mix-up of characters in String. If you are familiar with String API, i.e. java.lang.String than you can easily solve this problem. In order to check if Strings are anagram, you need to get there character array and see if they are equal or not. Though you can also use indexOf() , substring() and StringBuffer or StringBuilder class to solve this question. In this Java program, we will see 3 ways to solve this interview questions, and check if two String are anagram or not. By the way, if you are preparing for Java interview, it's good to

How to generate MD5 Hash in Java - String Byte Array digest Example

There are multiple ways to generate the MD5 hash in Java program. Not only Java API provides a convenient method for generating MD5 hash, you can also use popular open source frameworks like Spring and Apache commons Codec to generate MD5 digest in Java. MD5 is popular Message Digest Algorithm, which is most commonly used to check data integrity e.g. comparing MD5 checksum to see, if any file is altered or not. Though MD5 has not considered a good cryptographic algorithm for security purpose due to several vulnerabilities found on it, it's still good enough or checking the integrity of the file. MD5 hashing algorithm generates a 128 bit or 16-byte long hash value. MD5 hash values , also known as MD5 digest is mostly represented as 32 character Hex String. You can generate an MD5 hash from a byte array , or String directly using Java, Spring and Apache commons codec. Spring and Apache commons codec has identical API e.g. class name DigestUtil s is same and allows you to directl

10 Famous Laws of Computer Programming and Software Enginnering World

Like any other field, Software and Programming world too has some interesting and famous rules, principles and laws, which programmers, developers, managers and architects use often in conversations, meetings and chats. These laws are either rules, principles, or famous words from great personalities of computer programming world. At the same time these laws are interesting, funny, worth knowing, and few of them are just amazing to read. I have sharing things which is worth knowing and useful for not only Java programmer but also developers from other programming language e.g. we have seen 10 Object oriented design principles , which is not only useful for Java guys but also with any OOPS programmer. In this article, I am going to share my collection of 10 famous software and computer programming laws , I am sure you would have few more to add into this list. Please share a computer programming rules, or a thought of wisdom, which is worth knowing among software professional. Read more

Top 15 Data Structures and Algorithm Interview Questions for Java programmer - Answers

Data structures and algorithm questions are an important part of any programming job interview, be it a Java interview, C++ interview or any other programming language. Since data structures are core programming concept, it's mandatory for all programmers, to know basic data structures like stack, linked list, queue, array, tree, and graph. Though tree and graph are on the tough side, I still see programmers get familiar will all these. Any lis t of programming job interview questions is incomplete without questions from data structures and algorithms. Similarly, while going on questions from data structure you may get some programming exercise as well e . g. swapping numbers without temp variable. The li nked list and array are favorite topics in any data structure interview, questions like reversing linked list, traversing linked list or deleting nodes from linked list, which involves algorithm and data structures are quite common. Read more �

How to get Key from Value in Hashtable, HashMap or Map in Java

It's not easy to get key from value in Hashtable or HashMap, as compared to getting value from key because HashMap or Hashtable doesn't enforce one to one mapping between key and value inside Map in Java. in fact, Map allows same value to be mapped to multiple keys insid e HashMap , Hashtable or any other Map implementation. What you have in your kitty is Hashtable.containsValue(String value) or Hashtable.containsKey(String key) to check whether key or value exists in Hashtable or not, but sometimes we want to retrieve a value from Map corresponding to any key and there is no API method to do in Map. We can still do this, but it highly depends data in your Map because Hashtable and HashMap both allows duplicate value s mapped to the different key. In this Java tutorial, we will see an example of how to get key from value in Hashtable in Java. Read more �

How to Swap Two Numbers without Temp or Third variable in Java - Interview Question

How to swap two numbers without using temp or third variable is common interview question not just on Java interviews but also on C and C++ interviews. It is also a good programming questions for freshers . This question was asked to me long back and didn't had any idea about how to approach this question without using temp or third variable, may be lack of knowledge on bitwise operators in Java or may be it didn't click at that time. Given some time and trial error, I eventually come out with a solution with just arithmetic operator but interviewer was keep asking about other approaches of swapping two variables without using temp or third variable . Personally, I liked this question and included in list o f my programming interview question bec ause of its simplicity and some logical work, it force you to do. When learned bit-wise operation in Java I eventually find another way of swapping two variables without third variable, which I am going to share with you guys. Read m

How to create and call stored procedure in MySQL with IN and OUT parameters

It's hard to remember exact syntax of, how to create stored procedure in MySQL, until you are creating and working on stored procedure frequently, simply because syntax is not a one liner. You need to remember exact syntax, if you are using MySQL database from command line. What help in this case is, quick examples. In last couple of MySQL tutorial we have seen How to find second highest salary and How to join 3 tables in one query ; In this MySQL tutorial we will see couple of examples of creating stored procedure and calling stored procedure using IN and OUT parameters . All these MySQL examples are simple and help you to understand syntax of creating stored procedure with parameters in MySQL. These examples are tested in MySQL 5.5 database. We will also use following employee table to create and test these stored procedures : Read more �

How to convert XMLGregorianCalendar to Date to XMLGregorianCalendar in Java - Example Tutorial

There are several ways to convert XMLGregorianCalendar to Date in Java. You can convert XMLGregorianCalendar to either java.util.Date or java.sql.Date based upon your need . JAXB (Java API/Architecture for XML Bindings) is a popular framework to create XML documents from Java Objects and Java objects from XML files. JAXB also helps to create Java classes from XML Schema file (.XSD file). By default JAXB maps XSD data type xs:date , xs:time and xs:dateTime to XMLGregorianCalendar in Java, but you can configure XJC to create java.util.Date objects instead of javax.xml.datatype.XMLGregorianCalendar . Sin ce java.util.Date is most popular way of dealing with date and time in Java, we often need to convert XMLGregorianCalendar instance to Date instance in Java. Thankfully by using Java API, we can easily do this conversion of XMLGregorianCalendar to Date and Date to XMLGregorianCalendar in Java. By the way, It's good to remember that XML Schema has three different types wh