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:
.8x = $70.40
x = 70.4/.8
x = $88
Step-by-step explanation:
Answer:
2 ;-;
Step-by-step explanation:
Given:
21 country songs
18 alternative songs
16 pop songs
18 rock songs
Find:
Total number of songs on
Deborah’s Mp3 player using addition and multiplication
Solution:
<span>For addition, we just directly
add all the variables:
21 country songs</span> + 18
alternative songs + 16 pop songs + 18 rock songs = 73 total number of songs
For multiplication, we must
take note that there are two 18 songs with different genre so we can solve it
using multiplication like this:
(18 songs (alternative and
rock) * 2) + 21 country songs + 16 pop songs = 73 total number of songs.
<span>Overall, there are 73 number
of songs in Deborah’s MP3 player.</span>