Collage graduates that are currently jobless or looking to apply for a jod
Answer:
#include <iostream>
using namespace std;
int main()
{
int arr[]={3,-9,9,33,-4,-5, 100,4,-23};
int pos;
int n=sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<n;i++){
if(arr[i]>=0){
pos++;
}
}
cout<<"Number of positive integers is "<<pos<<endl;
return 0;
}
Explanation:
create the main function in the c++ programming and declare the array with the element. Then, store the size of array by using the formula:
int n=sizeof(arr)/sizeof(arr[0]);
after that, take a for loop for traversing the array and then check condition for positive element using if statement,
condition is array element greater than or equal to zero.
if condition true then increment the count by 1.
this process happen until the condition true
and finally print the count.
Answer:
num = float(input("Enter a number : "))
ab = abs(num)
sqrt = float(ab ** 0.5)
print(sqrt)
Explanation:
Answer:
Sheave wheel and hoist cable
Explanation:
The sheave wheel is a pulley wheel that sits above the mine shaft. The hoist cable passes over the sheave wheel and then down the shaft of the mine. The sheave wheel reduces the sliding friction of the mine cable. The head frame is the structure that supports the sheave wheel.
Answer:
Here is the Python program:
COOKIES_PER_BAG = 40 #sets constant value for bag of cookies
SERVINGS_PER_BAG = 10 #sets constant value for serving in bag
CALORIES_PER_SERVING = 300 #sets constant value servings per bag
cookies = int(input("How many cookies did you eat? ")) #prompts user to input how many cookies he or she ate
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG)); #computes total calories consumed by user
print("Total calories consumed:",totalCalories) #displays the computed value of totalCalories consumed
Explanation:
The algorithm is:
- Start
- Declare constants COOKIES_PER_BAG, SERVINGS_PER_BAG and CALORIES_PER_SERVING
- Set COOKIES_PER_BAG to 40
- Set SERVINGS_PER_BAG to 10
- Set CALORIES_PER_SERVING to 300
- Input cookies
- Calculate totalCalories: totalCalories ← cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG))
- Display totalCalories
I will explain the program with an example:
Lets say user enters 5 as cookies he or she ate so
cookies = 5
Now total calories are computed as:
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG));
This becomes:
totalCalories = 5 * (300/40/10)
totalCalories = 5 * (300/4)
totalCalories = 5 * 75
totalCalories = 375
The screenshot of program along with its output is attached.