Answer:
1. Input array of 100 numbers
mx = 0
for (int i = 0; i < 100; i++)
if (arr[i] > mx)
mx = arr[i]
Output mx
2. Input array of 100 numbers
mx = 0
for (int i = 0; i < 100; i++)
if (arr[i] > mx)
mx = arr[i]
mx = mx * 0.9
3. Input three numbers
if(firstNumber > secondNumber) {
swap(firstNumber, secondNumber)
}
if (firstNumber > thirdNumber) {
swap(firstNumber, thirdNumber)
}
if (secondNumber > thirdNumber) {
swap(secondNumber, thirdNumber)
}
output firstNumber, secondNumber, thirdNumber
Explanation:
#include <iostream>
using namespace std;
class CarCounter {
public:
CarCounter();
CarCounter(const CarCounter& origCarCounter);
void SetCarCount(const int count) {
carCount = count;
}
int GetCarCount() const {
return carCount;
}
private:
int carCount;
};
CarCounter::CarCounter() {
carCount = 0;
return;
}
CarCounter::CarCounter(const CarCounter &p){
carCount = p.carCount;
}
void CountPrinter(CarCounter carCntr) {
cout << "Cars counted: " << carCntr.GetCarCount();
return;
}
int main() {
CarCounter parkingLot;
parkingLot.SetCarCount(5);
CountPrinter(parkingLot);
return 0;
}
Sample output:
Cars Counted: 5
Answer:
A is your answer hope this helps
Answer:
public static void main(String[] args) {
String ing[] = {"ten","fading","post","card","thunder","hinge","trailing","batting"};
for (String i: ing){
if (i.endsWith("ing")){
System.out.println(i);
}
}
}
Explanation:
The for-loop cycles through the entire list and the if-statement makes it so that the string is only printed if it ends with "ing"