Answer:
Algorithm
Start
Int n // To represent the number of array
Input n
Int countsearch = 0
float search
Float [] numbers // To represent an array of non decreasing number
// Input array elements but first Initialise a counter element
Int count = 0, digit
Do
// Check if element to be inserted is the first element
If(count == 0) Then
Input numbers[count]
Else
lbl: Input digit
If(digit > numbers[count-1]) then
numbers[count] = digit
Else
Output "Number must be greater than the previous number"
Goto lbl
Endif
Endif
count = count + 1
While(count<n)
count = 0
// Input element to count
input search
// Begin searching and counting
Do
if(numbers [count] == search)
countsearch = countsearch+1;
End if
While (count < n)
Output count
Program to illustrate the above
// Written in C++
// Comments are used for explanatory purpose
#include<iostream>
using namespace std;
int main()
{
// Variable declaration
float [] numbers;
int n, count;
float num, searchdigit;
cout<<"Number of array elements: ";
cin>> n;
// Enter array element
for(int I = 0; I<n;I++)
{
if(I == 0)
{
cin>>numbers [0]
}
else
{
lbl: cin>>num;
if(num >= numbers [I])
{
numbers [I] = num;
}
else
{
goto lbl;
}
}
// Search for a particular number
int search;
cin>>searchdigit;
for(int I = 0; I<n; I++)
{
if(numbers[I] == searchdigit
search++
}
}
// Print result
cout<<search;
return 0;
}
Answer: 3 stickers
Step-by-step explanation:
From the question, we know that Pippa's 8 friends have an equal amount of stickers, meaning that the number of stickers that Pippa gave out is a multiple of 8.
Also, we are able to know that Pippa gave as much as she can, meaning that she gave out the stickers until the number is the maximum multiple of 8.
First Five Multiple of 8 = 8, 16, 24, 32, 40
As we can see from the list, 8, 16, and 24 are all multiples of 8, but they are not the maximum number that could fit under 35 stickers. Similarly, 40 exceeds the number of stickers Pippa has. Thus, we are left with 32.
This means, Pippa gave out 32 stickers in total, and each friend got 4 stickers.
Also, this means Pippa would keep <u>3 stickers</u> for herself.
Hope this helps!! :)
Please let me know if you have any questions
Responder:
5,52
Explicación paso a paso:
Dado lo siguiente:
Precio por kilo de papa = 1.2
Kg de papa comprada = 2.2kg
Precio por kilo de arroz = 3.7 por kilo
Kg de arroz comprado = 3.2 kg
Valor del boleto emitido para el pago = 20
Precio total de la papa:
Precio * kg comprado
1.2 * 2.2 = 2.64
Precio total del arroz:
Precio * kg comprado
3.7 * 3.2 = 11.84
Cantidad total gastada = (precio total del arroz + precio total de la papa)
2.64 + 11. 84 = 14.48
Cambio pendiente = 20 - 14.48 = 5.52
Answer:
y = 3x - 5
Step-by-step explanation:
y = mx + b
y - b = mx
-b = mx - y
b = -mx + y
b = -3(1) -2
b = -5