Skip to content

isp-cluj/isp-lab-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starting from the template, implement the following exercises:

  1. Implement a program according to speciffications bellow:
  • Generate a random number n between 2 and 10;
  • Populate an array of size n with integers read from the keyboard;
  • Compute the arithmetical mean of the array populated in previous step.
  1. Implement an application that allows the users to search and find all the words that start with a specific letter in an array. First, the user is asked to input all the words, on one line, separated by comma (e.g. apples,computer,bread,tea,car). Next, the user is asked to input the starting letter. The result(s) are to be printed on a new line. Hint: use the String's split() method to extract the words from the first input line. Then, store them into an array.

  • Write a program which display the geometric mean of the primes number from [a,b] where a,b->[1,200] a<b, a and b are read from keyboard.
  • Giving a vector of first N prime numbers, display the number of prime numbers which have the sum of digits an even number.
  1. Given an vector of N integer elements. Display the first prime/odd/even number from the vector and their respective position

  2. Generate a vector of size 20 with random elements from [-1000,1000].
    -display the vector.
    -sort the vector using bubbleSort or quickSort or mergeSort or any sort method
    -display the sorted vector

  3. Generate a vector which multiply the precedent 2 values from the vector. First 2 elements of the vector are always 1 and 2. Generate first n elements(n >= 8)
    EX: 1, 2, 2, 4, 8, 32, 256, 8192, ...
    a) non-recursively
    b) recursively

  4. Write a guessing game where the user has to guess a secret number. After every guess the program tells the user whether their number was too large or too small. At the end the number of tries needed should be printed. It counts only as one try if they input the same number multiple times consecutively.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages