Answer:
import java.util.*;
public class PerfectNum{
public static String isPerfect(long number){
String s = "";
long sum = 0;
//Checking if the number is perfect or not
for(long i = 1; i < number; i++){
if(number % i == 0){
sum += i;
}
}
if(sum == number){
for(long i = 1; i < number; i++){
String t = "";
if(number % i == 0){
long n = i;
//Converting into string
while(n > 0){
long p = n % 10;
t += (char)(p + '0');
n /= 10;
}
//Reversing the number
for(int j = t.length() - 1; j >= 0; j--){
s += t.charAt(j);
}
s += " ";
}
}
}
return s;
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("Enter maximum number");
long n = sc.nextLong();
System.out.println("Displaying perfect numbers 2 to " + n);
for(long i = 2; i <= n; i++){
String s = isPerfect(i);
if(s != "")
System.out.println(s +"->" + i);
}
}
}
Answer:
When possible, use public transportation, walk, or ride a bike
Explanation:
Answer:
The heat transfer is 29.75 kJ
Explanation:
The process is a polytropic expansion process
General polytropic expansion process is given by PV^n = constant
Comparing PV^n = constant with PV^1.2 = constant
n = 1.2
(V2/V1)^n = P1/P2
(V2/0.02)^1.2 = 8/2
V2/0.02 = 4^(1/1.2)
V2 = 0.02 × 3.2 = 0.064 m^3
W = (P2V2 - P1V1)/1-n
P1 = 8 bar = 8×100 = 800 kPa
P2 = 2 bar = 2×100 = 200 kPa
V1 = 0.02 m^3
V2 = 0.064 m^3
1 - n = 1 - 1.2 = -0.2
W = (200×0.064 - 800×0.02)/-0.2 = -3.2/-0.2 = 16 kJ
∆U = 55 kJ/kg × 0.25 kg = 13.75 kJ
Heat transfer (Q) = ∆U + W = 13.75 + 16 = 29.75 kJ
Answer:
It serves as a guarantee that the contractor who wins the bid will honor the terms of the bid after the contract is signed.
Explanation:
A bid bond is a type of construction bond that protects the obligee in a construction bidding process.
A bid bond typically involves three parties:
The obligee; the owner or developer of the construction project under bid. The principal; the bidder or proposed contractor.
The surety; the agency that issues the bid bond to the principal example insurance company or bank.
A bid bond generally serves as a guarantee that the contractor who wins the bid will honor the terms of the bid after the contract is signed.
Answer:
Below is the desired C++ program for the problem. Do feel free to edit it according to your preference
Explanation:
#include <iostream>
#include <vector>
using namespace std;
void ExactChange(int userTotal, vector<int> &coinVals) {
coinVals.reserve(5);
coinVals[0] = userTotal / 100;
userTotal %= 100;
coinVals[1] = userTotal / 25;
userTotal %= 25;
coinVals[2] = userTotal / 10;
userTotal %= 10;
coinVals[3] = userTotal / 5;
userTotal %= 5;
coinVals[4] = userTotal;
}
int main() {
vector<int> coins;
int value;
cin >> value;
if (value <= 0) {
cout << "no change" << endl;
} else {
ExactChange(value, coins);
if (coins[0] != 0) cout << coins[0] << " " << (coins[0] == 1 ? "dollar" : "dollars") << endl;
if (coins[1] != 0) cout << coins[1] << " " << (coins[1] == 1 ? "quarter" : "quarters") << endl;
if (coins[2] != 0) cout << coins[2] << " " << (coins[2] == 1 ? "dime" : "dimes") << endl;
if (coins[3] != 0) cout << coins[3] << " " << (coins[3] == 1 ? "nickel" : "nickels") << endl;
if (coins[4] != 0) cout << coins[4] << " " << (coins[4] == 1 ? "penny" : "pennies") << endl;
}
return 0;
}