Answer:
import java.util.Scanner;
public class FindMatchValue {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
final int NUM_VALS = 4;
int[] userValues = new int[NUM_VALS];
int i;
int matchValue;
int numMatches = -99; // Assign numMatches with 0 before your for loop
matchValue = scnr.nextInt();
for (i = 0; i < userValues.length; ++i) {
userValues[i] = scnr.nextInt();
}
/* Your solution goes here */
numMatches = 0;
for (i = 0; i < userValues.length; ++i) {
if(userValues[i] == matchValue) {
numMatches++;
}
}
System.out.println("matchValue: " + matchValue + ", numMatches: " + numMatches);
}
}
Answer:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
string name[5];
int age[5];
int i,j;
for ( i = 0; i<=4; i++ ) {
cout << "Please enter student's name:";
cin >> name[i];
cout << "Please enter student's age:";
cin >> age[i];
}
for (i=0;i<=4;i++){
cout<<"Age of "<< name[i]<<" is "<<age[i]<<endl;
}
}
Output of above program is displayed in figure attached.
Answer:
(C) ln [Bi]
Explanation:
Radioactive materials will usually decay based on their specific half lives. In radioactivity, the plot of the natural logarithm of the original radioactive material against time will give a straight-line curve. This is mostly used to estimate the decay constant that is equivalent to the negative of the slope. Thus, the answer is option C.