// Simple Java program to find sum of series
// with cubes of first n natural numbers
import java.util.*;
import java.lang.*;
class GFG {
/* Returns the sum of series */
public static int sumOfSeries(int n)
{
int sum = 0;
for (int x = 1; x <= n; x++)
sum += x * x * x;
return sum;
}
// Driver Function
public static void main(String[] args)
{
int n = 5;
System.out.println(sumOfSeries(n));
}
}
// Code Contributed by Mohit Gupta_OMG <(0_o)>
Answer:
The expression is :
π[cd) + π(g,h) ],[π(e,f)+π(a,b)])
We will use foreign key and primary key
<span>Hard disk drives
</span><span>RAM<span>Random access memory (RAM)
</span></span><span>External hard disks
<span>USB port
</span></span>CD and DVD drives
<span>Memory cards</span>
Answer:
see explaination
Explanation:
import java.io.*;
import java.util.Scanner;
public class Winners {
public static void main(String args[]) throws IOException {
Scanner sc = new Scanner(new File("WorldSeriesWinners.txt"));
String commands[] = new String[100000];
int c = 0;
while (sc.hasNextLine()) {
String input = sc.nextLine();
System.out.println(input);
if (input.isEmpty())
continue;
commands[c++] = input;
}
sc.close();
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter the name of a team: ");
String name = keyboard.nextLine();
int count = 0;
for (int i = 0; i < c; i++) {
if (commands[i] != null) {
if (commands[i].equals(name)) {
++count;
}
}
}
if(count!=0)
System.out.println(name + " has won the World Series in the time period from 1903 through 2018 " +count + " number of times" );
else
System.out.println("Team with name "+name+ " does not exists");
}
}