Answer:
I think the answer is to translate messages from one machine’s programming language into another
Explanation:
Answer:
Answer given below
Explanation:
a) 10 coins ( 25*8 + 1*2)
b) 14 coins (27*10 + 12*1 + 7*1 + 3*1 + 1*1)
<u></u>
<u>Source Code in C++:
</u>
#include <iostream>
using namespace std;
//main function
int main()
{
int n,n1;
cout << "Enter the amount : "; //taking amount as input
cin >> n;
if(n<=0)
{
cout << "Fatal Error : Input Failure." << endl;
return 1;
}
cout << "Enter the number of denominations : "; //taking number of denominations as input
cin >> n1;
if(n1<=0)
{
cout << "Fatal Error : Input Failure." << endl;
return 1;
}
int a[n1],c[n1],sum=0; //array to keep count of each amount, and sum to store total coins
cout << "Enter the denominations in descending order : ";
for(int i=0;i<n1;i++)
{
cin >> a[i];
}
for(int i=0;i<n1;i++)
{
c[i]=n/a[i];
sum=sum+c[i];
n=n%a[i];
}
for(int i=0;i<5;i++)
{
cout << a[i] << " : " << c[i] << endl;
}
return 0;
}
Answer:
mother board hope this helps
Answer:
The code is given below with necessary comments for understanding
Explanation:
#Open the input file.
infile = open("numbers.txt", "r")
#Declare and initialize the required variable sum
#to store the sum of integers read from the file.
sum = 0
#Declare and intialize a variable to store the current
#number read from the file in the integer form.
curNum = 0
#Traverse the input file using for loop.
for curLine in infile:
#Assign the number read from the file to the
#variable curNum in the integr form.
curNum = int(curLine)
#Add the numbers read from the file to the
#variable sum to get the sum of all the
#numbers read from the file.
sum += curNum
# Display the value of the variable runsum.
print(sum)