This program calculates employee pay for a supermarket. It takes in employee ID, hourly rate, regular hours worked, overtime hours worked, tax rate, and parking fees. It uses formulas to calculate gross pay from regular and overtime hours and hourly rate. It then calculates net pay by subtracting taxes and parking fees from gross pay. The program has input, calculation, and output modules to get the necessary values, perform the calculations, and display the results.
The document contains 15 programming exercises that involve taking user input and performing calculations. The exercises cover topics like temperature conversion, cylinder volume calculation, compound interest calculation, BMI calculation, and more. For each exercise, sample input/output is provided to demonstrate how the program should work.
Write a program that uses nested loops to collect data and calculate .docxajoy21
The program uses nested loops to collect rainfall data over a specified number of years. The outer loop iterates once for each year entered by the user. The inner loop iterates 12 times, once for each month, prompting the user to enter the rainfall for that month. After all iterations, the program displays the total number of months, total rainfall, and average monthly rainfall. Input validation is included to reject years less than 1 or negative rainfall amounts.
import java.util.Scanner; import java.text.; public class Ave.pdfanitasahani11
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println(\"Enter the number of years: \");
years = input.nextInt();
System.out.println(\"Enter the rainfall amount for each month \");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j
Solution
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println(\"Enter the number of years: \");
years = input.nextInt();
System.out.println(\"Enter the rainfall amount for each month \");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j.
The document describes activities for building a streaming data platform on AWS using Kinesis services. It discusses creating a Kinesis stream and populating it with data. Then it covers processing the stream data using Kinesis Analytics by writing SQL queries, filtering data, and calculating aggregates. Finally, it demonstrates delivering the data from Kinesis Analytics to S3 using Kinesis Firehose.
This document describes a compound interest calculator project created in Python using the Tkinter GUI module. It introduces Python and explains why it is a preferred language. It then discusses the project, which allows users to calculate simple and compound interest. It provides details on how the Tkinter GUI is created and the compound interest calculation formula and steps used in the program.
The java Payroll that prompts user to enter hourly rate .pdfangelfashions02
/**
* The java Payroll that prompts user to enter
* hourly rate of pay and number of hours worked.
* Then calculates the gross pay and net pay
* and print to console.
* */
//Payroll.java
import java.util.Scanner;
public class Payroll
{
public static void main(String[] args)
{
//declare variables for hourly rate and hours worked
double hourlyRate;
int hoursWorked;
//Set tax rate as 0.15 (15 percent )
final double WITH_HOLD_TAX=0.15;
//Set grossPay=0
double grossPay=0;
//Set tax =0
double tax=0;
//Set netPay=0
double netPay=0;
//Create an instance of Scanner class
Scanner inputScanner =new Scanner(System.in);
System.out.println(\"Enter hourly rate of pay\");
//prompt for hourly rate
hourlyRate=Integer.parseInt(inputScanner.nextLine());
System.out.println(\"Enter number of hours worked\");
//prompt for number of hours
hoursWorked=Integer.parseInt(inputScanner.nextLine());
//Calculate grossPay
//multiply hoursWorked by hourlyRate
grossPay=hoursWorked*hourlyRate;
//calculate with hold tax
tax=grossPay*WITH_HOLD_TAX;
//calculate netPay
//subtract tax from grossPay
netPay=grossPay-tax;
//print gross pay and net pay to console
System.out.println(\"Gross Pay : \"+grossPay);
System.out.println(\"Net pay : \"+netPay);
}
}
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Sample output:
Enter hourly rate of pay
10
Enter number of hours worked
50
Gross Pay : 500.0
Net pay : 425.0
Solution
/**
* The java Payroll that prompts user to enter
* hourly rate of pay and number of hours worked.
* Then calculates the gross pay and net pay
* and print to console.
* */
//Payroll.java
import java.util.Scanner;
public class Payroll
{
public static void main(String[] args)
{
//declare variables for hourly rate and hours worked
double hourlyRate;
int hoursWorked;
//Set tax rate as 0.15 (15 percent )
final double WITH_HOLD_TAX=0.15;
//Set grossPay=0
double grossPay=0;
//Set tax =0
double tax=0;
//Set netPay=0
double netPay=0;
//Create an instance of Scanner class
Scanner inputScanner =new Scanner(System.in);
System.out.println(\"Enter hourly rate of pay\");
//prompt for hourly rate
hourlyRate=Integer.parseInt(inputScanner.nextLine());
System.out.println(\"Enter number of hours worked\");
//prompt for number of hours
hoursWorked=Integer.parseInt(inputScanner.nextLine());
//Calculate grossPay
//multiply hoursWorked by hourlyRate
grossPay=hoursWorked*hourlyRate;
//calculate with hold tax
tax=grossPay*WITH_HOLD_TAX;
//calculate netPay
//subtract tax from grossPay
netPay=grossPay-tax;
//print gross pay and net pay to console
System.out.println(\"Gross Pay : \"+grossPay);
System.out.println(\"Net pay : \"+netPay);
}
}
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Sample output:
E.
This program calculates employee pay for a supermarket. It takes in employee ID, hourly rate, regular hours worked, overtime hours worked, tax rate, and parking fees. It uses formulas to calculate gross pay from regular and overtime hours and hourly rate. It then calculates net pay by subtracting taxes and parking fees from gross pay. The program has input, calculation, and output modules to get the necessary values, perform the calculations, and display the results.
The document contains 15 programming exercises that involve taking user input and performing calculations. The exercises cover topics like temperature conversion, cylinder volume calculation, compound interest calculation, BMI calculation, and more. For each exercise, sample input/output is provided to demonstrate how the program should work.
Write a program that uses nested loops to collect data and calculate .docxajoy21
The program uses nested loops to collect rainfall data over a specified number of years. The outer loop iterates once for each year entered by the user. The inner loop iterates 12 times, once for each month, prompting the user to enter the rainfall for that month. After all iterations, the program displays the total number of months, total rainfall, and average monthly rainfall. Input validation is included to reject years less than 1 or negative rainfall amounts.
import java.util.Scanner; import java.text.; public class Ave.pdfanitasahani11
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println(\"Enter the number of years: \");
years = input.nextInt();
System.out.println(\"Enter the rainfall amount for each month \");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j
Solution
import java.util.Scanner;
import java.text.*;
public class AverageRainfall {
public static void main(String[] args) {
int years; // Variable to hold the amount of years
final int MONTHS = 12; // Constant to hold the amount of months in a year
int totalMonths = 0; // Months accumulator variable
double monthlyRain; // Holds the amount of rain in inches for each month
double totalRainfall = 0; // Holds the total rainfall
NumberFormat df = DecimalFormat.getInstance(); // Decimal formating
df.setMaximumFractionDigits(2);
// Create Scanner object
Scanner input = new Scanner(System.in);
// Prompt user for the number of years
System.out.println(\"Enter the number of years: \");
years = input.nextInt();
System.out.println(\"Enter the rainfall amount for each month \");
// Construct for-loop for each year
for(int i=0; i < years; i++){
for(int j=1; j.
The document describes activities for building a streaming data platform on AWS using Kinesis services. It discusses creating a Kinesis stream and populating it with data. Then it covers processing the stream data using Kinesis Analytics by writing SQL queries, filtering data, and calculating aggregates. Finally, it demonstrates delivering the data from Kinesis Analytics to S3 using Kinesis Firehose.
This document describes a compound interest calculator project created in Python using the Tkinter GUI module. It introduces Python and explains why it is a preferred language. It then discusses the project, which allows users to calculate simple and compound interest. It provides details on how the Tkinter GUI is created and the compound interest calculation formula and steps used in the program.
The java Payroll that prompts user to enter hourly rate .pdfangelfashions02
/**
* The java Payroll that prompts user to enter
* hourly rate of pay and number of hours worked.
* Then calculates the gross pay and net pay
* and print to console.
* */
//Payroll.java
import java.util.Scanner;
public class Payroll
{
public static void main(String[] args)
{
//declare variables for hourly rate and hours worked
double hourlyRate;
int hoursWorked;
//Set tax rate as 0.15 (15 percent )
final double WITH_HOLD_TAX=0.15;
//Set grossPay=0
double grossPay=0;
//Set tax =0
double tax=0;
//Set netPay=0
double netPay=0;
//Create an instance of Scanner class
Scanner inputScanner =new Scanner(System.in);
System.out.println(\"Enter hourly rate of pay\");
//prompt for hourly rate
hourlyRate=Integer.parseInt(inputScanner.nextLine());
System.out.println(\"Enter number of hours worked\");
//prompt for number of hours
hoursWorked=Integer.parseInt(inputScanner.nextLine());
//Calculate grossPay
//multiply hoursWorked by hourlyRate
grossPay=hoursWorked*hourlyRate;
//calculate with hold tax
tax=grossPay*WITH_HOLD_TAX;
//calculate netPay
//subtract tax from grossPay
netPay=grossPay-tax;
//print gross pay and net pay to console
System.out.println(\"Gross Pay : \"+grossPay);
System.out.println(\"Net pay : \"+netPay);
}
}
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Sample output:
Enter hourly rate of pay
10
Enter number of hours worked
50
Gross Pay : 500.0
Net pay : 425.0
Solution
/**
* The java Payroll that prompts user to enter
* hourly rate of pay and number of hours worked.
* Then calculates the gross pay and net pay
* and print to console.
* */
//Payroll.java
import java.util.Scanner;
public class Payroll
{
public static void main(String[] args)
{
//declare variables for hourly rate and hours worked
double hourlyRate;
int hoursWorked;
//Set tax rate as 0.15 (15 percent )
final double WITH_HOLD_TAX=0.15;
//Set grossPay=0
double grossPay=0;
//Set tax =0
double tax=0;
//Set netPay=0
double netPay=0;
//Create an instance of Scanner class
Scanner inputScanner =new Scanner(System.in);
System.out.println(\"Enter hourly rate of pay\");
//prompt for hourly rate
hourlyRate=Integer.parseInt(inputScanner.nextLine());
System.out.println(\"Enter number of hours worked\");
//prompt for number of hours
hoursWorked=Integer.parseInt(inputScanner.nextLine());
//Calculate grossPay
//multiply hoursWorked by hourlyRate
grossPay=hoursWorked*hourlyRate;
//calculate with hold tax
tax=grossPay*WITH_HOLD_TAX;
//calculate netPay
//subtract tax from grossPay
netPay=grossPay-tax;
//print gross pay and net pay to console
System.out.println(\"Gross Pay : \"+grossPay);
System.out.println(\"Net pay : \"+netPay);
}
}
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Sample output:
E.
This document describes a C++ program that calculates employee wages. It contains sections for acknowledgements, introduction, system requirements, source code, output, and conclusions. The program allows the user to enter information for multiple employees, including name, phone number, hours worked, and hourly wage. It then calculates and displays each employee's pay for the week. The program uses arrays to store employee data and functions for the menu, data entry, and report display.
The document contains 12 code examples for Java programs that perform various tasks like greeting a user, calculating triangle area, printing even numbers, generating Fibonacci sequences, calculating factorials, determining if a number is even/odd, comparing two numbers, determining if a number is positive/negative, generating a multiplication table, and reversing a string. Each code example demonstrates the use of basic Java concepts like variables, conditionals, loops, methods, and classes to solve common programming problems.
C++ Please I am posting the fifth time and hoping to get th.pdfjaipur2
C++
"Please I am posting the fifth time and hoping to get this resolved. I want the year to
change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015.
Also, Please I want personal information in the heading as well Name: Last: and Course
Name:"
Modify the Time class(attached) to be able to work with Date class. The Time object should
always
remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to
increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick
member function in a loop that prints the time in standard format during iteration of the loop to
illustrate that the tick member function works correctly. Be aware that we are testing the following
cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)),
minute (0
59), and second (0 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute,
getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls
printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members (hour, minute and second) data.
3. The setHour function takes one integer but doesnt return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesnt return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesnt return anything. It validates and stores
the integer to the second private data member.
Page 3 of 11 CISP400V10A4
6. The getHour constant function returns one integer but doesnt take anything. It returns the
private data member hours data.
7. The getMinute constant function returns one integer but doesnt take anything. It returns the
private data member minutes data.
8. The getSecond constant function returns one integer but doesnt take anything. It returns the
private data member seconds data.
9. The Time destructor does not take anything. It displays "Time object destructor is
called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-ti.
Please I am posting the fifth time and hoping to get this r.pdfankit11134
"Please I am posting the fifth time and hoping to get this resolved. I want the year to
change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015.
Also, Please I want personal information in the heading as well Name: Last: and Course
Name:"
Modify the Time class(attached) to be able to work with Date class. The Time object should
always
remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to
increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick
member function in a loop that prints the time in standard format during iteration of the loop to
illustrate that the tick member function works correctly. Be aware that we are testing the following
cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)),
minute (0
59), and second (0 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute,
getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls
printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members (hour, minute and second) data.
3. The setHour function takes one integer but doesnt return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesnt return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesnt return anything. It validates and stores
the integer to the second private data member.
Page 3 of 11 CISP400V10A4
6. The getHour constant function returns one integer but doesnt take anything. It returns the
private data member hours data.
7. The getMinute constant function returns one integer but doesnt take anything. It returns the
private data member minutes data.
8. The getSecond constant function returns one integer but doesnt take anything. It returns the
private data member seconds data.
9. The Time destructor does not take anything. It displays "Time object destructor is
called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-time f.
The document provides instructions for creating several C++ classes:
1. An Int class that imitates the functionality of the basic int data type with member functions to initialize, display, and add Int values.
2. A tollBooth class that tracks the number of cars passed and total money collected using member functions to increment counts and totals for paying and non-paying cars.
3. A time class that stores hours, minutes, seconds and includes member functions to initialize, display in a formatted string, and add two time objects.
4. An employee class that stores an ID number and compensation amount and includes member functions to enter and display an employee's data.
5. An Integer class that represents
Project 2Project 2.pdfIntroduction to Programming EECS 1.docxwkyra78
Project 2/Project 2.pdf
Introduction to Programming EECS 1500
Project 2 Elementary Aspects of C++
100 Points - Due Thursday February 11 in class
The revision is for part a on Modulo division
Note: These projects should be completed by February 4. They are all formally due in class, on
Thursday February 11. This later date is only given to help students who enroll late for the class.
a. Modulo Division Write a program to read in a 3-digit integer and print out the sum of the digits of
the integer. Use the % operator to extrct the digits and use the / operator to extract the digit. Use the
following format for input/output:
Enter an integer: 744
The sum of the digits is: 15
b. Approximating Pi Pi can be computed using the formula
4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - . . .)
Write a program to display the result of
4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13)
Note: be sure to use 1.0 not 1 in your program.
c. Wind Chill The National Weather Service has a relatively new formula to measure the wind chill
temperature. The formula is
Wind Chill = 35.74 + 0.6215T - 35.75V0.16 + 0.4275TV0.16
where T = outside temperature (°F) and V = wind velocity (mph). The formula cannot be used for
wind speeds below 2 mph, temperatures below -58°F, or temperatures above 41°F.
Write a program that prompts the user to enter a temperature and a wind speed, and then displays the
wind chill temperature. You may assume the values entered are valid.
Enter temperature(Fahrenheit): 5.3
Enter wind speed(mph): 6
The wind chill index is -5
d. Distance Given the two points (x1, y1) and (x2, y2), the distance between these points is given
by the formula:
Write a program that prompts the user to enter the two points, and then displays the distance between
them. You may assume the values entered are valid. For example,
Enter x1 and y1: 1.0 5
Enter x2 and y2: -2.0 1
The distance is 5.0
Project 2/quiz1.txt
package splitter;
import java.util.Scanner;
public class Split {
public static void main(String[] args)
{
int i = 234;
sumDigits(i);
}
private static void sumDigits(int digits)
{
System.out.println("digits before calculation: " + digits);
int sum = 0;
while ( digits > 0 )
{
sum += digits % 10;
digits /= 10;
System.out.println("sum: " + sum);
System.out.println("digits after calculation: " + digits);
}
}
}
Project 2/quiz2.txt
package pi;
public class Pi {
public static void main(String[] args) {
double pi;
pi=4*((1.0+1/5+1/9+1/13)-(1/3+1/11+1/7));
System.out.print("The Pi is :" +pi);
}
}
Project 2/quiz3.txt
package temperature;
import java.util.Scanner;
public class Temperature {
public static void main(String[] args) {
Scanne ...
Bottom of FormCreate your own FunctionFunctionsFor eac.docxAASTHA76
Bottom of Form
Create your own Function
Functions
For each discussion, provide a snipplet of pseudo-code for the Main using an example call to the Function as well as the pseudo-code for the Function.
For each discussion, do the problem you are assigned to as described by the letters below.
Discussion 1 - Using Pseudocode, create a Function that accepts one or more input Integer numbers and returns a float number. You should name your function appropriately as to what it does. Be sure to document your Function with header and in-line comments.
Provide a snipplet of psuedo-code for the Main using an example call to the Function.
Make sure the variable names in the Main are different that in the Function. In the Main, provide the prompts and get the user responses. Then pass the data into the Function. After the call to the Function include a print statements that indicates the returning value from the call to the Function.
Put Discussion 1 - problem no.X in the Subject area.
You are assigned the problem no. below as follows: If your Last Name begins with:
A-B - do no. 1
C-F - do no. 2
G-H - do no. 3
I-K - do no. 4
L - do no. 5
M-P - do no. 6
Q-T - do no. 7
U-Z - do no. 8
1)Calculate the Area of a circle. Input: one number
2)Calculate the Circumference a circle. Input: one number
3)Convert the temperature from Celcius to Farenheit Input: one number
4)Convert the temperature from Farenheit to Celcius. Input: one number
5)Calculate 6 times a number squared. Input: one number
6)Calculate 3 times the (sum of three numbers). Input: three numbers
7)Calculate the average of four numbers. Input: four numbers
8)Calculate 5 times the (difference of two numbers). Input two numbers
You may do additional problems, if you want.
Discussion 2:
Convert Discussion 1 to C-code. Don't for get to prototype your function before the main and to define your function after the main. Put Discussion 2 - problem no.X in the Subject area and submit a .txt (or .c) file for your code.
CMIS 102 Hands-On Lab
Week 6
Overview:
This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), Test Plan, and implementation with C code. The example provided uses sequential, repetition, selection statements and two user-defined function.
Program Description:
This program will provide options for a user to calculate the square or cube of a positive Integer input by a user. The program will prompt the user to enter an Integer and then prompt the user if they want to calculate the square of the cube of the number. Based on the inputs of the user, the program will output the square of the cube of the positive integer. The program will then print the Integer and square or cube of the integer based on the user’s original choice. The program will continue to prompt the user for
Integers and their calculation choice until the user enters a negative int ...
The document discusses how timers work in Linux systems. There are two kernel counters that track time - one for seconds and one for microseconds since January 1, 1970. The gettimeofday function returns the current time by reading these counters. There are also per-process timers that track the time each process has spent running. A timer interrupt triggers every 10 milliseconds to increment the jiffies counter and schedule timer bottom half processing, which updates the system clock and process times. Processes can also initialize interval timers using setitimer to generate signals when the timers expire.
The document discusses Java 8's new date and time API (JSR 310). It provides examples of using the new classes like LocalDate, LocalTime, LocalDateTime and Instant that model dates, times and timestamps without time zones. It also covers formatting and parsing dates and times, working with time zones using ZoneId and ZonedDateTime, durations using Duration, and periods of time using Period. The document compares the new API to the legacy Date and Calendar classes and notes improvements like immutability and removal of bugs in the previous implementation.
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
Digits.java
package week04;
import java.util.Scanner;
public class Digits {
public static void main(String[] args)
{
//Declaring variables
int sum=0,number,rem;
//Scanner class Object is sued to read the inputs entered by the user
Scanner input = new Scanner(System.in);
//Getting the number entered by the user
System.out.print(\"Enter an integer : \");
number=input.nextInt();
//this loop continue to execute until the number is graeter than zero
while (number>0 )
{
//Getting the last digit of the number every time
rem=number%10;
/*Getting the remaining part of
* the number except last digit every time
*/
number=number/10;
//Calculating the sum of the digits
sum+=rem;
}
//Displaying the sum of the digits of the number
System.out.print(\"The sum of digits is: \" +sum);
}
}
______________________________________________
Output:
Enter an integer : 123456789
The sum of digits is: 45
__________________________________________Thank You
Solution
Digits.java
package week04;
import java.util.Scanner;
public class Digits {
public static void main(String[] args)
{
//Declaring variables
int sum=0,number,rem;
//Scanner class Object is sued to read the inputs entered by the user
Scanner input = new Scanner(System.in);
//Getting the number entered by the user
System.out.print(\"Enter an integer : \");
number=input.nextInt();
//this loop continue to execute until the number is graeter than zero
while (number>0 )
{
//Getting the last digit of the number every time
rem=number%10;
/*Getting the remaining part of
* the number except last digit every time
*/
number=number/10;
//Calculating the sum of the digits
sum+=rem;
}
//Displaying the sum of the digits of the number
System.out.print(\"The sum of digits is: \" +sum);
}
}
______________________________________________
Output:
Enter an integer : 123456789
The sum of digits is: 45
__________________________________________Thank You.
Modify the Time classattached to be able to work with Date.pdfaaseletronics2013
Modify the Time class(attached) to be able to work with Date class. The Time object should
always remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to increase day, month and year when it is proper. Please use CISP400V10A4.cpp that
tests the tick member function in a loop that prints the time in standard format during iteration of
the loop to illustrate that the tick member function works correctly. Be aware that we are testing
the following cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
You can adjust only programs (Date.cpp, Date.h, Time.cpp and Time.h) to generate the
required result but not the code in CISP400V10A4.cpp file.
Expecting results:
// Date.cpp
// Date class member-function definitions.
#include <array>
#include <string>
#include <iostream>
#include <stdexcept>
#include "Date.h" // include Date class definition
using namespace std;
// constructor confirms proper value for month; calls
// utility function checkDay to confirm proper value for day
Date::Date(int mn, int dy, int yr, Time time)
: time01(time)
{
if (mn > 0 && mn <= monthsPerYear) // validate the month
month = mn;
else
throw invalid_argument("month must be 1-12");
year = yr; // could validate yr
day = checkDay(dy); // validate the day
// output Date object to show when its constructor is called
cout << "Date object constructor for date ";
print();
cout << endl;
} // end Date constructor
// print Date object in form month/day/year
void Date::print() const
{
cout << month << '/' << day << '/' << year;
cout << "t";
time01.printStandard();
cout << "t";
time01.printUniversal();
cout << "n";
} // end function print
// output Date object to show when its destructor is called
Date::~Date()
{
cout << "Date object destructor for date ";
print();
cout << endl;
} // end ~Date destructor
// utility function to confirm proper day value based on
// month and year; handles leap years, too
unsigned int Date::checkDay(int testDay) const
{
static const array< int, monthsPerYear + 1 > daysPerMonth =
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
// determine whether testDay is valid for specified month
if (testDay > 0 && testDay <= daysPerMonth[month])
{
return testDay;
} // end if
// February 29 check for leap year
if (month == 2 && testDay == 29 && (year % 400 == 0 || (year % 4 == 0 && year
% 100 != 0)))
{
return testDay;
} // end if
cout << "day (" << testDay << ") set to 1." << endl;
return 1;
} // end function checkDay
// adjust data if day is not proper
void Date::increaseADay()
{
day = checkDay(day + 1);
if (day == 1) // if day wasn't accurate, its value is one
{
month = month + 1; // increase month by 1
if (month > 0 && month >= monthsPerYear) // if.
Proposed pricing model for cloud computingAdeel Javaid
Cloud computing is an emerging technology of business computing and it is becoming a development trend. The process of entering into the cloud is generally in the form of queue, so that each user needs to wait until the current user is being served. In the system, each Cloud Computing User (CCU) requests Cloud Computing Service Provider (CCSP) to use the resources, if CCU(cloud computing user) finds that the server is busy then the user has to wait till the current user completes the job which leads to more queue length and increased waiting time. So to solve this problem, it is the work of CCSP’s to provide service to users with less waiting time otherwise there is a chance that the user might be leaving from queue. CCSP’s can use multiple servers for reducing queue length and waiting time. In this paper, we have shown how the multiple servers can reduce the mean queue length and waiting time. Our approach is to treat a multiserver system as an M/M/m queuing model, such that a profit maximization model could be worked out.
The document discusses C#.NET programs and various simple console applications that demonstrate basic programming concepts like input/output, conditional statements, loops, arrays, and pattern printing. It includes 10 programs that perform tasks like calculating sums, swapping values, checking odd/even, and more. It also covers 4 programs using different looping structures and 5 programs that print numeric patterns using nested loops.
Brenda Chapman is an American animator, director, and storyboard artist best known for her work at Disney and Pixar. She was the first woman to direct a major animated feature, Pixar's Brave (2012). Some of her other notable works include being a key story artist for Beauty and the Beast and directing The Lion King. After leaving Pixar, she founded Chapman Lima Productions with her husband and is developing the upcoming film Come Away. Her motto is to stand up for yourself while mentoring others.
The document discusses barriers to communication. It defines communication as the exchange of information, ideas, thoughts, and emotions so that everyone gains a common understanding of the intended message. It then outlines five main barriers to effective communication: language barriers due to specialist jargon or abstract terms; physical barriers due to distance or visual/accent disconnections; physiological barriers like speech or hearing disorders; psychological barriers such as attitudes and emotions; and cultural barriers relating to differences in gender, age, or diversity. The document concludes by suggesting solutions for overcoming communication barriers like ensuring clarity of thoughts, understanding the audience, getting feedback, using body language, avoiding overload of information, and controlling emotions.
Stop motion animation is a filmmaking technique where objects are physically manipulated in small increments between individually photographed frames to create the illusion of movement. There are several types of stop motion animation, including model animation which merges with live action footage, puppet animation using human-like figures, clay animation which deforms malleable backgrounds and characters, and cut-out animation using flat materials like paper and photographs. The document provides an overview of different stop motion techniques and discusses the creator's planned clay animation story about a person feeling ignored until they learn to smile and appreciate life's blessings.
This document discusses the process of controlling project scope. It defines scope as the set of deliverables or features of a project derived from requirements. Controlling scope is important to monitor progress, ensure deliverables meet requirements, and manage changes. Key inputs for controlling scope are the project management plan, requirements documentation, work performance data, and organizational process assets. Variance analysis is used to compare the actual and planned scope. Important outputs are work performance information, change requests, and updates to plans and documents. Controlling scope helps manage any differences between the planned and implemented scope.
Here is the program to check if a number entered by the user is odd or even:
import java.util.Scanner;
public class OddEven {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter an integer: ");
int number = input.nextInt();
if(number % 2 == 0) {
System.out.println("The number is even");
}
else {
System.out.println("The number is odd");
}
}
}
This document discusses variables in Java programming. It explains that variables act like dishes that hold data of a specified type. An example shows declaring an integer variable x and assigning it the value 10, which is correct, while assigning 10 to the variable x would be wrong. It then provides examples of computing areas of shapes like circles and squares using variables to hold values and formulas. The key aspects covered are data types, declaring and assigning values to variables, and using variables in calculations and output.
This document discusses Java key concepts like comments, examples of Java code, reserved words, modifiers, and classes. It contains code examples to demonstrate single-line and multi-line comments. It also lists Java reserved words, modifiers like public and private, and defines a class as a blueprint for objects.
This document describes a C++ program that calculates employee wages. It contains sections for acknowledgements, introduction, system requirements, source code, output, and conclusions. The program allows the user to enter information for multiple employees, including name, phone number, hours worked, and hourly wage. It then calculates and displays each employee's pay for the week. The program uses arrays to store employee data and functions for the menu, data entry, and report display.
The document contains 12 code examples for Java programs that perform various tasks like greeting a user, calculating triangle area, printing even numbers, generating Fibonacci sequences, calculating factorials, determining if a number is even/odd, comparing two numbers, determining if a number is positive/negative, generating a multiplication table, and reversing a string. Each code example demonstrates the use of basic Java concepts like variables, conditionals, loops, methods, and classes to solve common programming problems.
C++ Please I am posting the fifth time and hoping to get th.pdfjaipur2
C++
"Please I am posting the fifth time and hoping to get this resolved. I want the year to
change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015.
Also, Please I want personal information in the heading as well Name: Last: and Course
Name:"
Modify the Time class(attached) to be able to work with Date class. The Time object should
always
remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to
increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick
member function in a loop that prints the time in standard format during iteration of the loop to
illustrate that the tick member function works correctly. Be aware that we are testing the following
cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)),
minute (0
59), and second (0 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute,
getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls
printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members (hour, minute and second) data.
3. The setHour function takes one integer but doesnt return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesnt return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesnt return anything. It validates and stores
the integer to the second private data member.
Page 3 of 11 CISP400V10A4
6. The getHour constant function returns one integer but doesnt take anything. It returns the
private data member hours data.
7. The getMinute constant function returns one integer but doesnt take anything. It returns the
private data member minutes data.
8. The getSecond constant function returns one integer but doesnt take anything. It returns the
private data member seconds data.
9. The Time destructor does not take anything. It displays "Time object destructor is
called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-ti.
Please I am posting the fifth time and hoping to get this r.pdfankit11134
"Please I am posting the fifth time and hoping to get this resolved. I want the year to
change from 2014 to 2015 but the days of the month change to 32 rather than 1/1/2015.
Also, Please I want personal information in the heading as well Name: Last: and Course
Name:"
Modify the Time class(attached) to be able to work with Date class. The Time object should
always
remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to
increase day, month and year when it is proper. Please use CISP400V10A4.cpp that tests the tick
member function in a loop that prints the time in standard format during iteration of the loop to
illustrate that the tick member function works correctly. Be aware that we are testing the following
cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)),
minute (0
59), and second (0 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute,
getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls
printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members (hour, minute and second) data.
3. The setHour function takes one integer but doesnt return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesnt return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesnt return anything. It validates and stores
the integer to the second private data member.
Page 3 of 11 CISP400V10A4
6. The getHour constant function returns one integer but doesnt take anything. It returns the
private data member hours data.
7. The getMinute constant function returns one integer but doesnt take anything. It returns the
private data member minutes data.
8. The getSecond constant function returns one integer but doesnt take anything. It returns the
private data member seconds data.
9. The Time destructor does not take anything. It displays "Time object destructor is
called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-time f.
The document provides instructions for creating several C++ classes:
1. An Int class that imitates the functionality of the basic int data type with member functions to initialize, display, and add Int values.
2. A tollBooth class that tracks the number of cars passed and total money collected using member functions to increment counts and totals for paying and non-paying cars.
3. A time class that stores hours, minutes, seconds and includes member functions to initialize, display in a formatted string, and add two time objects.
4. An employee class that stores an ID number and compensation amount and includes member functions to enter and display an employee's data.
5. An Integer class that represents
Project 2Project 2.pdfIntroduction to Programming EECS 1.docxwkyra78
Project 2/Project 2.pdf
Introduction to Programming EECS 1500
Project 2 Elementary Aspects of C++
100 Points - Due Thursday February 11 in class
The revision is for part a on Modulo division
Note: These projects should be completed by February 4. They are all formally due in class, on
Thursday February 11. This later date is only given to help students who enroll late for the class.
a. Modulo Division Write a program to read in a 3-digit integer and print out the sum of the digits of
the integer. Use the % operator to extrct the digits and use the / operator to extract the digit. Use the
following format for input/output:
Enter an integer: 744
The sum of the digits is: 15
b. Approximating Pi Pi can be computed using the formula
4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - . . .)
Write a program to display the result of
4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13)
Note: be sure to use 1.0 not 1 in your program.
c. Wind Chill The National Weather Service has a relatively new formula to measure the wind chill
temperature. The formula is
Wind Chill = 35.74 + 0.6215T - 35.75V0.16 + 0.4275TV0.16
where T = outside temperature (°F) and V = wind velocity (mph). The formula cannot be used for
wind speeds below 2 mph, temperatures below -58°F, or temperatures above 41°F.
Write a program that prompts the user to enter a temperature and a wind speed, and then displays the
wind chill temperature. You may assume the values entered are valid.
Enter temperature(Fahrenheit): 5.3
Enter wind speed(mph): 6
The wind chill index is -5
d. Distance Given the two points (x1, y1) and (x2, y2), the distance between these points is given
by the formula:
Write a program that prompts the user to enter the two points, and then displays the distance between
them. You may assume the values entered are valid. For example,
Enter x1 and y1: 1.0 5
Enter x2 and y2: -2.0 1
The distance is 5.0
Project 2/quiz1.txt
package splitter;
import java.util.Scanner;
public class Split {
public static void main(String[] args)
{
int i = 234;
sumDigits(i);
}
private static void sumDigits(int digits)
{
System.out.println("digits before calculation: " + digits);
int sum = 0;
while ( digits > 0 )
{
sum += digits % 10;
digits /= 10;
System.out.println("sum: " + sum);
System.out.println("digits after calculation: " + digits);
}
}
}
Project 2/quiz2.txt
package pi;
public class Pi {
public static void main(String[] args) {
double pi;
pi=4*((1.0+1/5+1/9+1/13)-(1/3+1/11+1/7));
System.out.print("The Pi is :" +pi);
}
}
Project 2/quiz3.txt
package temperature;
import java.util.Scanner;
public class Temperature {
public static void main(String[] args) {
Scanne ...
Bottom of FormCreate your own FunctionFunctionsFor eac.docxAASTHA76
Bottom of Form
Create your own Function
Functions
For each discussion, provide a snipplet of pseudo-code for the Main using an example call to the Function as well as the pseudo-code for the Function.
For each discussion, do the problem you are assigned to as described by the letters below.
Discussion 1 - Using Pseudocode, create a Function that accepts one or more input Integer numbers and returns a float number. You should name your function appropriately as to what it does. Be sure to document your Function with header and in-line comments.
Provide a snipplet of psuedo-code for the Main using an example call to the Function.
Make sure the variable names in the Main are different that in the Function. In the Main, provide the prompts and get the user responses. Then pass the data into the Function. After the call to the Function include a print statements that indicates the returning value from the call to the Function.
Put Discussion 1 - problem no.X in the Subject area.
You are assigned the problem no. below as follows: If your Last Name begins with:
A-B - do no. 1
C-F - do no. 2
G-H - do no. 3
I-K - do no. 4
L - do no. 5
M-P - do no. 6
Q-T - do no. 7
U-Z - do no. 8
1)Calculate the Area of a circle. Input: one number
2)Calculate the Circumference a circle. Input: one number
3)Convert the temperature from Celcius to Farenheit Input: one number
4)Convert the temperature from Farenheit to Celcius. Input: one number
5)Calculate 6 times a number squared. Input: one number
6)Calculate 3 times the (sum of three numbers). Input: three numbers
7)Calculate the average of four numbers. Input: four numbers
8)Calculate 5 times the (difference of two numbers). Input two numbers
You may do additional problems, if you want.
Discussion 2:
Convert Discussion 1 to C-code. Don't for get to prototype your function before the main and to define your function after the main. Put Discussion 2 - problem no.X in the Subject area and submit a .txt (or .c) file for your code.
CMIS 102 Hands-On Lab
Week 6
Overview:
This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), Test Plan, and implementation with C code. The example provided uses sequential, repetition, selection statements and two user-defined function.
Program Description:
This program will provide options for a user to calculate the square or cube of a positive Integer input by a user. The program will prompt the user to enter an Integer and then prompt the user if they want to calculate the square of the cube of the number. Based on the inputs of the user, the program will output the square of the cube of the positive integer. The program will then print the Integer and square or cube of the integer based on the user’s original choice. The program will continue to prompt the user for
Integers and their calculation choice until the user enters a negative int ...
The document discusses how timers work in Linux systems. There are two kernel counters that track time - one for seconds and one for microseconds since January 1, 1970. The gettimeofday function returns the current time by reading these counters. There are also per-process timers that track the time each process has spent running. A timer interrupt triggers every 10 milliseconds to increment the jiffies counter and schedule timer bottom half processing, which updates the system clock and process times. Processes can also initialize interval timers using setitimer to generate signals when the timers expire.
The document discusses Java 8's new date and time API (JSR 310). It provides examples of using the new classes like LocalDate, LocalTime, LocalDateTime and Instant that model dates, times and timestamps without time zones. It also covers formatting and parsing dates and times, working with time zones using ZoneId and ZonedDateTime, durations using Duration, and periods of time using Period. The document compares the new API to the legacy Date and Calendar classes and notes improvements like immutability and removal of bugs in the previous implementation.
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
Digits.java
package week04;
import java.util.Scanner;
public class Digits {
public static void main(String[] args)
{
//Declaring variables
int sum=0,number,rem;
//Scanner class Object is sued to read the inputs entered by the user
Scanner input = new Scanner(System.in);
//Getting the number entered by the user
System.out.print(\"Enter an integer : \");
number=input.nextInt();
//this loop continue to execute until the number is graeter than zero
while (number>0 )
{
//Getting the last digit of the number every time
rem=number%10;
/*Getting the remaining part of
* the number except last digit every time
*/
number=number/10;
//Calculating the sum of the digits
sum+=rem;
}
//Displaying the sum of the digits of the number
System.out.print(\"The sum of digits is: \" +sum);
}
}
______________________________________________
Output:
Enter an integer : 123456789
The sum of digits is: 45
__________________________________________Thank You
Solution
Digits.java
package week04;
import java.util.Scanner;
public class Digits {
public static void main(String[] args)
{
//Declaring variables
int sum=0,number,rem;
//Scanner class Object is sued to read the inputs entered by the user
Scanner input = new Scanner(System.in);
//Getting the number entered by the user
System.out.print(\"Enter an integer : \");
number=input.nextInt();
//this loop continue to execute until the number is graeter than zero
while (number>0 )
{
//Getting the last digit of the number every time
rem=number%10;
/*Getting the remaining part of
* the number except last digit every time
*/
number=number/10;
//Calculating the sum of the digits
sum+=rem;
}
//Displaying the sum of the digits of the number
System.out.print(\"The sum of digits is: \" +sum);
}
}
______________________________________________
Output:
Enter an integer : 123456789
The sum of digits is: 45
__________________________________________Thank You.
Modify the Time classattached to be able to work with Date.pdfaaseletronics2013
Modify the Time class(attached) to be able to work with Date class. The Time object should
always remain in a consistent state.
Modify the Date class(attached) to include a Time class object as a composition, a tick member
function that increments the time stored in a Date object by one second, and increaseADay
function to increase day, month and year when it is proper. Please use CISP400V10A4.cpp that
tests the tick member function in a loop that prints the time in standard format during iteration of
the loop to illustrate that the tick member function works correctly. Be aware that we are testing
the following cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
You can adjust only programs (Date.cpp, Date.h, Time.cpp and Time.h) to generate the
required result but not the code in CISP400V10A4.cpp file.
Expecting results:
// Date.cpp
// Date class member-function definitions.
#include <array>
#include <string>
#include <iostream>
#include <stdexcept>
#include "Date.h" // include Date class definition
using namespace std;
// constructor confirms proper value for month; calls
// utility function checkDay to confirm proper value for day
Date::Date(int mn, int dy, int yr, Time time)
: time01(time)
{
if (mn > 0 && mn <= monthsPerYear) // validate the month
month = mn;
else
throw invalid_argument("month must be 1-12");
year = yr; // could validate yr
day = checkDay(dy); // validate the day
// output Date object to show when its constructor is called
cout << "Date object constructor for date ";
print();
cout << endl;
} // end Date constructor
// print Date object in form month/day/year
void Date::print() const
{
cout << month << '/' << day << '/' << year;
cout << "t";
time01.printStandard();
cout << "t";
time01.printUniversal();
cout << "n";
} // end function print
// output Date object to show when its destructor is called
Date::~Date()
{
cout << "Date object destructor for date ";
print();
cout << endl;
} // end ~Date destructor
// utility function to confirm proper day value based on
// month and year; handles leap years, too
unsigned int Date::checkDay(int testDay) const
{
static const array< int, monthsPerYear + 1 > daysPerMonth =
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
// determine whether testDay is valid for specified month
if (testDay > 0 && testDay <= daysPerMonth[month])
{
return testDay;
} // end if
// February 29 check for leap year
if (month == 2 && testDay == 29 && (year % 400 == 0 || (year % 4 == 0 && year
% 100 != 0)))
{
return testDay;
} // end if
cout << "day (" << testDay << ") set to 1." << endl;
return 1;
} // end function checkDay
// adjust data if day is not proper
void Date::increaseADay()
{
day = checkDay(day + 1);
if (day == 1) // if day wasn't accurate, its value is one
{
month = month + 1; // increase month by 1
if (month > 0 && month >= monthsPerYear) // if.
Proposed pricing model for cloud computingAdeel Javaid
Cloud computing is an emerging technology of business computing and it is becoming a development trend. The process of entering into the cloud is generally in the form of queue, so that each user needs to wait until the current user is being served. In the system, each Cloud Computing User (CCU) requests Cloud Computing Service Provider (CCSP) to use the resources, if CCU(cloud computing user) finds that the server is busy then the user has to wait till the current user completes the job which leads to more queue length and increased waiting time. So to solve this problem, it is the work of CCSP’s to provide service to users with less waiting time otherwise there is a chance that the user might be leaving from queue. CCSP’s can use multiple servers for reducing queue length and waiting time. In this paper, we have shown how the multiple servers can reduce the mean queue length and waiting time. Our approach is to treat a multiserver system as an M/M/m queuing model, such that a profit maximization model could be worked out.
The document discusses C#.NET programs and various simple console applications that demonstrate basic programming concepts like input/output, conditional statements, loops, arrays, and pattern printing. It includes 10 programs that perform tasks like calculating sums, swapping values, checking odd/even, and more. It also covers 4 programs using different looping structures and 5 programs that print numeric patterns using nested loops.
Similar to Easy practice with current timemillis method (13)
Brenda Chapman is an American animator, director, and storyboard artist best known for her work at Disney and Pixar. She was the first woman to direct a major animated feature, Pixar's Brave (2012). Some of her other notable works include being a key story artist for Beauty and the Beast and directing The Lion King. After leaving Pixar, she founded Chapman Lima Productions with her husband and is developing the upcoming film Come Away. Her motto is to stand up for yourself while mentoring others.
The document discusses barriers to communication. It defines communication as the exchange of information, ideas, thoughts, and emotions so that everyone gains a common understanding of the intended message. It then outlines five main barriers to effective communication: language barriers due to specialist jargon or abstract terms; physical barriers due to distance or visual/accent disconnections; physiological barriers like speech or hearing disorders; psychological barriers such as attitudes and emotions; and cultural barriers relating to differences in gender, age, or diversity. The document concludes by suggesting solutions for overcoming communication barriers like ensuring clarity of thoughts, understanding the audience, getting feedback, using body language, avoiding overload of information, and controlling emotions.
Stop motion animation is a filmmaking technique where objects are physically manipulated in small increments between individually photographed frames to create the illusion of movement. There are several types of stop motion animation, including model animation which merges with live action footage, puppet animation using human-like figures, clay animation which deforms malleable backgrounds and characters, and cut-out animation using flat materials like paper and photographs. The document provides an overview of different stop motion techniques and discusses the creator's planned clay animation story about a person feeling ignored until they learn to smile and appreciate life's blessings.
This document discusses the process of controlling project scope. It defines scope as the set of deliverables or features of a project derived from requirements. Controlling scope is important to monitor progress, ensure deliverables meet requirements, and manage changes. Key inputs for controlling scope are the project management plan, requirements documentation, work performance data, and organizational process assets. Variance analysis is used to compare the actual and planned scope. Important outputs are work performance information, change requests, and updates to plans and documents. Controlling scope helps manage any differences between the planned and implemented scope.
Here is the program to check if a number entered by the user is odd or even:
import java.util.Scanner;
public class OddEven {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter an integer: ");
int number = input.nextInt();
if(number % 2 == 0) {
System.out.println("The number is even");
}
else {
System.out.println("The number is odd");
}
}
}
This document discusses variables in Java programming. It explains that variables act like dishes that hold data of a specified type. An example shows declaring an integer variable x and assigning it the value 10, which is correct, while assigning 10 to the variable x would be wrong. It then provides examples of computing areas of shapes like circles and squares using variables to hold values and formulas. The key aspects covered are data types, declaring and assigning values to variables, and using variables in calculations and output.
This document discusses Java key concepts like comments, examples of Java code, reserved words, modifiers, and classes. It contains code examples to demonstrate single-line and multi-line comments. It also lists Java reserved words, modifiers like public and private, and defines a class as a blueprint for objects.
2. What do you know about (GMT)??
GMT is World Time and
the basis of every
world time zone
3. Program1
Write a program that displays current time in GMT in the format
hour:minute:second
To create the program we use the currentTimeMillis method in the System class
4. public class ShowCurrentTime {
public static void main(String[] args) {
// Obtain the total milliseconds since midnight, Jan 1, 1970
long totalMilliseconds = System.currentTimeMillis();
// Obtain the total seconds since midnight, Jan 1, 1970
long totalSeconds = totalMilliseconds / 1000;
// Compute the current second in the minute in the hour
long currentSecond = (int)(totalSeconds % 60);
// Obtain the total minutes
long totalMinutes = totalSeconds / 60;
// Compute the current minute in the hour
long currentMinute = (int)(totalMinutes % 60);
// Obtain the total hours
long totalHours = totalMinutes / 60;
// Compute the current hour
long currentHour = (int)(totalHours % 24);
// Display results
System.out.println("Current time is " + currentHour + ":"
+ currentMinute + ":" + currentSecond + " GMT");
}
}
Out
put
Current time is 2:13:6 GMT
5. Program 2
Keeping Two Digits After Decimal Points
public class show2Digit {
public static void main(String[ ]args) {
double purchaseAmount = 3.14;
double tax = purchaseAmount * 10.3;
System.out.println((int)(tax * 100)/100.0);
}
}
Output 32.34
6. Computing Loan Payments
The program asks the user to enter:
- Loan amount
- Annually interest rate
- Number of years
Then the program should compute:
- The monthly interest rate
- Monthly payment
- The total payment
12
)1(
11
arsnumberOfYe
erestRatemonthlyInt
erestRatemonthlyIntloanAmount
7. import java.util.Scanner;
public class ComputeLoan {
public static void main(String[] args) {
// Create a Scanner
Scanner input = new Scanner(System.in);
// Enter yearly interest rate
System.out.print("Enter yearly interest rate, for example 8.25: ");
double annualInterestRate = input.nextDouble();
// Obtain monthly interest rate
double monthlyInterestRate = annualInterestRate / 1200;
// Enter number of years
System.out.print(
"Enter number of years as an integer, for example 5: ");
int numberOfYears = input.nextInt();
Program 3
Computing Loan Payments
8. Program 3 continuous
Computing Loan Payments
// Enter loan amount
System.out.print("Enter loan amount, for example 120000.95: ");
double loanAmount = input.nextDouble();
// Calculate payment
double monthlyPayment = loanAmount * monthlyInterestRate / (1
- 1 / Math.pow(1 + monthlyInterestRate, numberOfYears * 12));
double totalPayment = monthlyPayment * numberOfYears * 12;
// Display results
System.out.println("The monthly payment is " +
(int)(monthlyPayment * 100) / 100.0);
System.out.println("The total payment is " +
(int)(totalPayment * 100) / 100.0);
}
}
Enter yearly interest rate, for example 8.25: 7
Enter number of years as an integer, for example 5: 3
Enter loan amount, for example 120000.95: 100000
The monthly payment is 3087.7
The total payment is 111157.54
Out put