JAVA PROGRAMMING
1)BuildLists:
Write a program to create an ArrayList<Integer>.
Fill it with numbers from 1 to 1000.
Then remove every even number.
Then remove every multiple of 3 remaining
Then remove every multiple of 5
Then remove every multiple of 7
Then sum the array, and print.
*Java program*
Use while loop
1.) Write a program that reads an integer, and then prints the
sum of the even and odd integers.
2.) Write program to calculate the sum of the following series
where in is input by user. (1/1 + 1/2 + 1/3 +..... 1/n)
Programming in C++
Write a program that prints the values in an array and the
addresses of the array’s elements using four different techniques,
as follows:
Array index notation using array name
Pointer/offset notation using array name
Array index notation using a pointer
Pointer/offset notation using a pointer
Learning Objectives
In this assignment, you will:
Use functions with array and pointer arguments
Use indexing and offset notations to access arrays
Requirements
Your code must use these eight functions, using
these...
DO THIS IN JAVA
Write a complete Java program. the program has two threads. One
thread prints all capital letters 'A' to'Z'. The other thread
prints all odd numbers from 1 to 21.
Write a multithreaded program that tests your solution to HW#1.
You will create several threads – for example, 100 – and each
thread will request a pid, sleep for a random period of time, and
then release the pid. (Sleeping for a random period approximates
the typical pid usage in which a pid is assigned to a new process,
the process executes and terminates, and the pid is released on the
process’ termination). On UNIX and Linux systems, sleeping is...
Java programming.
Write a public Java
class called DecimalTimer with public method displayTimer, that
prints a counter and then increments the number of seconds. The
counter will start at 00:00 and each time the number of seconds
reaches 60, minutes will be incremented. You will not need to
implement hours or a sleep function, but if minutes or seconds is
less than 10, make sure a leading zero is put to the left of the
number.
For example, 60
seconds:...
Write a Java program that takes in a string and a number and
prints back the string from the number repeatedly until the first
character... for example Pasadena and 4 will print PasaPasPaP.
Ask the user for the string and a number
Print back the string from the number repeatedly until the
first character
For both programs please utilize:
methods
arrays
loops
Turn in screenshots
java program
Create a program that creates and prints a random phone
number using the following format:
XXX-XXX-XXXX. Make sure your output include the
dashes. Do not let the first three
digits contain an 8 or 9 (HINT: do not be more
restrictive than that) and make sure that the second
set of three digits is not greater than 773.
Helpful Hint: Think though the
easiest way to construct the phone number. Each digit does do not
have to be determined...
Programming Language Required: C
Write a multithreaded program in C (not c++)
using the pthread library and dynamic memory(malloc) that
multiplies two matrices together. The numbers in the matrices must
be read in from a text file. The program should also check if the
two matrices are capable of being multiplied together. The amount
of threads used has to be dynamic. The user should be able to
choose how many threads they wish to use using the command line.
Finally,...
This for Java Programming
Write a java statement to import the java utilities.
Create a Scanner object to read input.
int Age;
Write a java statement to read the Age input
value
4 . Redo 1 to 3 using JOptionPane