1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
creativ13 [48]
3 years ago
11

Array, destination contains the number of 10 cities numbered 1 to 10 that the products were shipped to. Hence, 10 quantities of

product 4 were shipped to destination 8 and 9 quantities of product 2 were shipped to destination 7.
int product[70] = {4, 2, 4, 2, 4, 5, 5, 2, 2, 5, 5, 4, 3, 5, 4, 2, 5, 3, 1, 2, 2, 3, 3, 4, 5, 5, 4, 5, 3, 5, 5, 1, 4, 5, 1, 5, 3, 2, 4, 1, 2, 4, 5, 1, 5, 5, 5, 5, 5, 2, 5, 1, 4, 4, 4, 2, 3, 3, 3, 3, 4, 3, 5, 5, 3, 2, 3, 5, 3, 2};

int []quantity[70] = {10, 9, 6, 4, 10, 4, 9, 6, 10, 7, 3, 4, 4, 9, 1, 8, 9, 1, 5, 8, 7, 2, 3, 4, 10, 5, 6, 2, 1, 7, 2, 8, 6, 9, 8, 8, 7, 7, 9, 10, 6, 7, 8, 2, 1, 7, 6, 3, 3, 1, 8, 4, 10, 7, 1, 10, 6, 9, 8, 2, 4, 6, 1, 8, 2, 6, 10, 2, 6, 2};

int origination[70] = {2, 7, 5, 5, 7, 2, 7, 2, 7, 7, 5, 2, 5, 5, 5, 2, 2, 7, 2, 7, 7, 2, 2, 2, 2, 5, 7, 5, 7, 7, 5, 5, 2, 2, 5, 7, 2, 5, 7, 2, 5, 7, 2, 5, 7, 2, 2, 7, 2, 7, 5, 2, 2, 2, 5, 7, 2, 5, 5, 5, 7, 7, 2, 5, 2, 7, 5, 2, 5, 7};

int destination[70] = {8, 7, 3, 10, 2, 6, 4, 5, 1, 3, 5, 9, 5, 8, 6, 4, 3, 7, 1, 2, 7, 2, 8, 2, 2, 1, 2, 6, 10, 2, 7, 7, 8, 6, 8, 8, 4, 8, 3, 10, 6, 9, 4, 9, 5, 1, 7, 3, 1, 7, 5, 5, 4, 9, 3, 10, 8, 1, 1, 1, 1, 8, 10, 3, 5, 2, 8, 7, 4, 10};

The unit price of each product

Product Unit Cost
1 $11.95
2 $7.95
3 $19.95
4 $24.95
5 $15.95
Computers and Technology
2 answers:
Naddik [55]3 years ago
3 0

Answer:

#include <stdlib.h>

#include <stdio.h>

void func1(int product[]){

int orders[6]={0};

for(int i=0;i<70;i++){

orders[product[i]]++;

}

printf("Total number of each type of products that were bought\n");

for(int i=1;i<=5;i++){

printf("Product %d = %d\n",i,orders[i]);

}

}

void func2(int product[],int quantity[],float price[]){

float total_cost=0;

for(int i=0;i<70;i++){

total_cost+= price[product[i]]* quantity[i];

}

printf("The total cost of all 70 orders = %.2f\n",total_cost);

}

void func3(int product[],int quantity[],int destination[],float price[]){

float total_cost=0;

for(int i=0;i<70;i++){

if(destination[i]==8){

total_cost+= price[product[i]]* quantity[i];

}

}

printf("The total cost of all products shipped to destination 8 = %.2f\n",total_cost);

}

void func4(int product[],int quantity[],float price[]){

int total_orders=0;

for(int i=0;i<70;i++){

if(price[product[i]]* quantity[i]>=50){

total_orders++;

}

}

printf("The total number of orders where each order is $50 or more = %d\n",total_orders);

}

void func5(int product[],int quantity[],int origination[],float price[]){

int total_orders=0;

for(int i=0;i<70;i++){

if(origination[i]==3 && price[product[i]]* quantity[i]>=50){

total_orders++;

}

}

printf("The total number of orders that originated from 3 where each order is $50 or more. = %d\n",total_orders);

}

void func6(int product[],int quantity[],int origination[],float price[]){

float total_cost=0;

for(int i=0;i<70;i++){

if(origination[i]==3 && price[product[i]] * quantity[i]>=50){

total_cost += price[product[i]] * quantity[i];

}

}

printf("The total number of orders that originated from 3 where each order is $50 or more. = %.2f\n",total_cost);

}

void func7(int origination[],int destination[]){

int total_orders=0;

for(int i=0;i<70;i++){

if(origination[i]==3 && destination[i]==8){

total_orders++;

}

}

printf("The total number of orders that originated from 3 and shipped to 8. = %d\n",total_orders);

}

void func8(int product[],int quantity[],int origination[],int destination[],float price[]){

float total_cost=0;

for(int i=0;i<70;i++){

if(origination[i]==3 && destination[i]==8){

total_cost += price[product[i]] * quantity[i];

}

}

printf("The total cost of orders that originated from 3 and shipped to 8. = %.2f\n",total_cost);

}

void func9(int destination[]){

int total_orders=0;

for(int i=0;i<70;i++){

if(destination[i]!=8){

total_orders++;

}

}

printf("The total number of orders that was shipped to all destinations except to 8. = %d\n",total_orders);

}

void func10(int product[],int quantity[],int destination[],float price[]){

float total_cost=0;

for(int i=0;i<70;i++){

if(destination[i]!=8){

total_cost += price[product[i]] * quantity[i];;

}

}

printf("The total cost of orders that was shipped to all destinations except to 8. = %.2f\n",total_cost);

}

int main(){

int product[70] = {4, 2, 4, 2, 4, 5, 5, 2, 2, 5, 5, 4, 3, 5, 4, 2, 5, 3, 1, 2, 2, 3, 3, 4, 5, 5, 4, 5, 3, 5, 5, 1, 4, 5, 1, 5, 3, 2, 4, 1, 2, 4, 5, 1, 5, 5, 5, 5, 5, 2, 5, 1, 4, 4, 4, 2, 3, 3, 3, 3, 4, 3, 5, 5, 3, 2, 3, 5, 3, 2};

int quantity[70] = {10, 9, 6, 4, 10, 4, 9, 6, 10, 7, 3, 4, 4, 9, 1, 8, 9, 1, 5, 8, 7, 2, 3, 4, 10, 5, 6, 2, 1, 7, 2, 8, 6, 9, 8, 8, 7, 7, 9, 10, 6, 7, 8, 2, 1, 7, 6, 3, 3, 1, 8, 4, 10, 7, 1, 10, 6, 9, 8, 2, 4, 6, 1, 8, 2, 6, 10, 2, 6, 2};

int origination[70] = {2, 7, 5, 5, 7, 2, 7, 2, 7, 7, 5, 2, 5, 5, 5, 2, 2, 7, 2, 7, 7, 2, 2, 2, 2, 5, 7, 5, 7, 7, 5, 5, 2, 2, 5, 7, 2, 5, 7, 2, 5, 7, 2, 5, 7, 2, 2, 7, 2, 7, 5, 2, 2, 2, 5, 7, 2, 5, 5, 5, 7, 7, 2, 5, 2, 7, 5, 2, 5, 7};

int destination[70] = {8, 7, 3, 10, 2, 6, 4, 5, 1, 3, 5, 9, 5, 8, 6, 4, 3, 7, 1, 2, 7, 2, 8, 2, 2, 1, 2, 6, 10, 2, 7, 7, 8, 6, 8, 8, 4, 8, 3, 10, 6, 9, 4, 9, 5, 1, 7, 3, 1, 7, 5, 5, 4, 9, 3, 10, 8, 1, 1, 1, 1, 8, 10, 3, 5, 2, 8, 7, 4, 10};

float price[6]={0,11.95,7.95,19.95,24.95,15.25};

func1(product);

func2(product,quantity,price);

func3(product,quantity,destination,price);

func4(product,quantity,price);

func5(product,quantity,origination,price);

func6(product,quantity,origination,price);

func7(origination,destination);

func8(product,quantity,origination,destination,price);

func9(destination);

func10(product,quantity,destination,price);

}

Explanation:

The program inputs order, products and cities products are shipped.

After a series of conditional requirements being met, will output the destination each product os going to and the number of products with its associated price.

olga55 [171]3 years ago
3 0

Answer:

why.....just why...........

Explanation:

You might be interested in
Setting the isShowing property to false of the opacity property to o will delete an object from an Alice world.
Tema [17]
I think true I’m not for sure
5 0
3 years ago
Read 2 more answers
Write a program that asks the user to enter a number of seconds. There are 60 seconds in a minute. If the number of seconds ente
frez [133]

Answer:

// here is code in c.

#include <stdio.h>

// main function

int main()

{

// variable to store seconds

long long int second;

printf("enter seconds:");

// read the seconds

scanf("%lld",&second);

// if seconds is in between 60 and 3600

if(second>=60&& second<3600)

{

// find the minutes

int min=second/60;

printf("there are %d minutes in %lld seconds.",min,second);

}

// if seconds is in between 3600 and 86400

else if(second>=3600&&second<86400)

{

// find the hours

int hours=second/3600;

printf("there are %d minutes in %lld seconds.",hours,second);

}

// if seconds is greater than 86400

else if(second>86400)

{

// find the days

int days=second/86400;

printf("there are %d minutes in %lld seconds.",days,second);

}

return 0;

}

Explanation:

Read the seconds from user.If the seconds is in between 60 and 3600 then find the minutes by dividing seconds with 60 and print it.If seconds if in between 3600 and 86400 then find the hours by dividing second with 3600 and print it. If the seconds is greater than 86400 then find the days by dividing it with 86400 and print it.

Output:

enter seconds:89

there are 1 minutes in 89 seconds.

enter seconds:890000

there are 10 days in 890000 seconds.

8 0
2 years ago
NEED HELP PLEASE-
zysi [14]

Answer:i believe it is patents. i could be wrong

Explanation:

To protect your interests, consider two common strategies employed by inventors, amateur and professional alike. First, you can file a provisional patent application (if your invention is patent able)

5 0
2 years ago
Read 2 more answers
A raised dot (ú) shows where the enter key was pressed. true or false.
Yakvenalex [24]
False i doesnt  shows anything like this


6 0
3 years ago
WRITE A PROGRAM TO CALCULATE SIMPLE INTEREST
Alchen [17]

The simple interset program is a sequential program, and does not require loops and conditions

The simple interset program in Python, where comments are used to explain each line is as follows:

#This gets input for the principal amount

P = int(input("P = "))

#This gets input for the rate

R = int(input("R = "))

#This gets input for the number of years

N = int(input("N = "))

#This calculates the simple interest

I = P * R * T * 0.01

#This prints the simple interest

print("Simple Interest =",I)

Read more about simple interest at:

brainly.com/question/2294792

7 0
2 years ago
Other questions:
  • Descending selection sort with output during execution
    6·1 answer
  • A smart refrigerator can use _____ to detect when you are running low on milk, and then send a reminder to you on a wireless net
    14·1 answer
  • Chris needs to modify the default bullets that are used in a nonnumbered list in word. Which method should he use?
    9·2 answers
  • 1. To type a capital "C", you would use the ring finger of your left hand.
    15·2 answers
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • A user is unable to install virtualization software on a Windows 8.1 computer. The user verified the host has sufficient RAM, pl
    6·1 answer
  • Misperceptions can lead to miscommunication. List an example from the article.(site 1)
    10·2 answers
  • Viết thuật toán, chương trình xử lý hạn chế trong việc xử lý số liệu phần nguyên để hiển thị lên lcd
    14·1 answer
  • How does social network use message to entertain?
    14·1 answer
  • What is a trusted computing base (TCB)? Hosts on your network that support secure transmissions The operating system kernel and
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!