Answer:
The program to this question can be given as follows:
Program:
#defining variable quarters, dimes, and nickels.
quarters=int(input("Enter value of quarters: ")) #input value by user dimes=int(input("Enter value of dimes: ")) #input value by user nickels=int(input("Enter value of nickels: ")) #input value by user
#defining variable pennies
pennies = ((25*quarters)+(10*dimes)+(5*nickels))
#calculate value in pennies variable
print('Total number of coins in pennies is: ',pennies)#print value
Output:
Enter value of quarters: 3
Enter value of dimes: 2
Enter value of nickels: 1
Total number of coins in pennies is: 100
Explanation:
In the above python program code, firstly three variable "quarters, dimes, and nickels", all of these variable uses input function, that is used to take input value from the user side, in these variable, an int is used that defined, that user input only integer value.
- After taking input from the user a new variable "pennies" is defined, which is uses the user input values and calculates its addition.
- In the next line, print function is used, which uses variable "pennies" to print its calculated value.
Answer:
// The code segment is written in C++ programming language
// The code segment goes as follows
for (k = 0; k < nMembers; k++)
{
//check if memberID can be found in currentMembers
if (currentMembers[k] == memberID){
// If yes,
// assigns true to isAMember
isAMember = true;
k = nMembers;
}
else{
isAMember = false;
// If no
// assigns false to isAMember
}
}
// End of segment:
The following assumption were made in the code segment above.
There exists
1. An already declared and initialised int array currentMembers.
2. An already initialised int variable memberID
Line 3 initiates a loop to scan through the array
Line 6 checks for the condition below
If current element of array equals memberID then
It assigns true to isAMember and nMembers to k
Else
It assigns false to isAMember
As of the presented problem, the most probable answer and the most likely one, out of the options presented together with the problem, would be C. Save As.
Of the menu commands that are there, Save As would serve to be the command that you click when you want to make a copy of a currently open file and rename it. The difference between Save As and Save would be that Save would automatically just replace the old file with the new one, considering that there were changes that took over the file. Save As, on the other hand, would make the old file still available but would prompt the user to choose another file name for it and even presents the possibility of the file being saved in another file extension.