Question: Write a program that inputs three different integers from the keyboard, then prints the sum, the average, the product, the…
Question: Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the…
Question: (Printing Values with printf) Write a program that prints the numbers 1 to 4 on the same line. Write the…
Question: Write a program that asks the user to enter two numbers, obtains them from the user and prints their sum,…
The program below is the answer to Deitel’s Java How to Program (9th Edition) Chapter 5 Exercise 5.32.Question: According to…
Question: Develop a Java application that determines whether any of several department-store customers has exceeded the credit limit on a charge…
Question: Drivers are concerned with the mileage their automobiles get. One driver has kept track of several trips by recording the…
This is a simple Java program to produce a 12×12 multiplication table using 2-dimensional array.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> */ <br /><br />public class ArrayMultiplicationTable {<br /><br /> public static void main(String[] args) {<br /> int[][] demo = new int[12][12];<br /> int row = 1, column = 1;<br /> for (int x = 0; x < demo.length; x++) {<br /> for (int y = 0; y < demo[x].length; y++) {<br /> demo[x][y] = row * column;<br /> column = column + 1;<br /> }<br /> row = row + 1;<br /> column = 1;<br /> }<br /> for (int x = 0; x < demo.length; x++) {<br /> for (int y = 0; y < demo[x].length; y++) {<br /> System.out.print(" " + demo[x][y] + "t|");<br /> }<br /> System.out.println();<br /> }<br /> }<br />}<br /> |
See program output below Program output
The simple PHP program below displays a countdown timer between a set start time and a stop time.
1 2 |
<br />/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * PHP Countdown Timer Program<br /> *<br /> */<br /> <br /> <?php<br /> <br /> $targetTime = mktime(17,00,00,07,29,2016); //target stop time in seconds<br /> $currentTime = mktime(9,00,00,07,29,2016); //target stop time in seconds<br /> $difference = $targetTime - $currentTime; //difference between start and stop time in seconds<br /> $hours = (int) ($difference / 3600); //calculate number of hours<br /> $mins = (int) ($difference / 60); //calculate number of minutes<br /> /* if value of mins is greater than 59, divide it by 60<br /> and assign remainder to mins */ <br /> if ($mins --> 59) { <br /> $mins = (int) ($mins % 60); <br /> }<br /> <br /> print "n$hours hour(s) : $mins minute(s)";<br /> <br />?><br /> |
Note that function…
In the world of web development, the choice of which development language to use commonly comes down to two popular…
Write a program in C++ to count number of male and female students in class. Print out the number of…
Write a program in QBasic to count number of male and female students in class. Print out the number of…