0% found this document useful (0 votes)
2 views2 pages

Lab array

The document outlines a lab exercise focused on Java programming with arrays. It includes six exercises that require writing programs to sum array values, calculate averages, check for specific values, find maximums, display data graphically, and compute the product of corresponding elements in two arrays. Each exercise is designed to enhance understanding of array manipulation in Java.

Uploaded by

loainabil28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Lab array

The document outlines a lab exercise focused on Java programming with arrays. It includes six exercises that require writing programs to sum array values, calculate averages, check for specific values, find maximums, display data graphically, and compute the product of corresponding elements in two arrays. Each exercise is designed to enhance understanding of array manipulation in Java.

Uploaded by

loainabil28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab 4 : Array

Exercice1
Write a Java program to sum values of an array..
Exercice2

Write a Java program to calculate the average value of array elements.

Exercice3
Write a Java program to test if an array contains a specific value
Exercice4

Write a java program that declares an array with 7 elements of type int and finds the
maximum.

Exercice 5

Given the following array, display its data graphically by plotting each numeric value
as a bar of asterisks (*) as shown in the diagram.

int[] array = {10, 19, 5, 1, 7, 14, 0, 7, 5};

Exercice 6

Design and implement a java code that should reads two integer arrays A and B each
of size 4 from the user. The program then computes the product of corresponding
elements in both arrays and stores the result in an integer array C of the same size.
Your program should then print the array C.
Test your program with the following data:
2433
5624
Your output should be:

ARRAY A: 2 4 3 3

ARRAY B: 5 6 2 4

ARRAY C: 10 24 6 12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy