Write a statement that assigns cell_count with cell_count multiplied by 10. * performs multiplication. If the input is 10, the
Question:
You
Write a statement that assigns cell_count with cell_count multiplied by 10. * performs multiplication. If the input is 10, the output should be:
100
1 cell_count = int(input)
2
3 " Your solution goes here"
4
5 print(cell_count) Run
Answers
The complete program is:
cell_count = int(input())
cell_count = cell_count * 10
print(cell_count)
Explanation:
This line gets input for cell_count
cell_count = int(input())
This line multiplies cell_count by 10
cell_count = cell_count * 10
This prints the updated value of cell_count
print(cell_count)
a. $103,400
Explanation:
As we know that
Cost of goods sold = Beginning inventory + purchases - ending inventory
And,
Gross profit = Sales revenue - cost of goods sold
Since in the question it is given that
The ending inventory and beginning inventory had been overstated by $11,200 and $6,600 respectively
Since overstatement in the initial inventory raises the cost of the goods sold and decreases by that amount the gross profit & net income
And, overstatement in ending inventory reduced cost of goods sold and raised gross profit & net income by that amount.
So for overstated ending inventory the amount should be deducted and for overstated beginning inventory the condition would be reverse
So, the correct amount is
= incorrect pretax net income + overstatement in beginning inventory - overstatement in ending inventory
= $108,000 + $6,600 - $11,200
= $103,400
cell_count = int(input("Enter the value: "))
cell_count *= 10
print(cell_count)
Explanation:
Ask the user to enter a value and set it to the cell_count variable
Multiply the cell_count by 10 and assign it to the cell_count (It can also be written as cell_count = cell_count * 10)
Print the cell_count
import java.util.Scanner;
public class ss11{
public static void main (String[]args) {
Scanner keyboard = new Scanner (System.in)
String a1, a2, a3, a4, a5;
int i1, i2, i3, i4, i5;
System.out.println("Enter a four bit binary number:");
a1= keyboard.next();
a2= a1.substring(0,1);
a3= a1.substring(1,2);
a4= a1.substring(2,3);
a5= a1.substring(3,4);
i1 = Integer.parseInt(a2);
i2 = Integer.parseInt(a3);
i3 = Integer.parseInt(a4);
i4 = Integer.parseInt(a5);
i1= i1 * 8;
i2= i1 * 4;
i3= i1 * 2;
i4= i1 * 1;
i5= i1+i2+i3+i4;
System.out.println("The converted decimal number is: +i5);
}
}
Explanation:
public class
{
public static void main(String[] args)
{
BinaryConverter conv = new BinaryConverter();
String binStr = "01001101";
System.out.print(binStr + " in decimal is "+conv.BinToDec(binStr));
}
}
public class BinaryConverter
{
public int BinToDec(String binStr)
{
int d = 0;
while(binStr.length() > 0)
{
d = (d << 1) + ((binStr.charAt(0) == '1') ? 1: 0);
binStr = binStr.substring(1);
}
return d;
}
}
Explanation:
The program "eats" the string from left to right, and builds up the integer representation in variable "d" on the go. While there are digits left, it shifts the previous result to the left and sets the least signficant bit to 1 only if the corresponding string character is a 1.
import java.util.*;
public class BinaryToDecimal
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String binaryNumber;
int decimalNumber = 0;
System.out.print("Enter the binary number: ");
binaryNumber = input.nextLine();
for(int i=0; i<binaryNumber.length(); i++){
char c = binaryNumber.charAt(binaryNumber.length()-1-i);
int digit = Character.getNumericValue(c);
decimalNumber += (digit * Math.pow(2, i));
}
System.out.println(decimalNumber);
}
}
Explanation:
Create a Scanner object to be able to get input from the user
Declare the variables
Ask the user to enter the binaryNumber as a String
Create a for loop that iterates through the binaryNumber. Get each character using charAt() method. Convert that character to an integer value using Character.getNumericValue(). Add the multiplication of integer value and 2 to the power of i to the decimalNumber variable (cumulative sum)
When the loop is done, print the decimalNumber variable
This is how i solved this:
9+7=1616 divided by 12 = 1.3 (repeater)1.3 (repeater) = 1 3/10Addison should put 1 3/10 pounds of salad in each container.