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
tigry1 [53]
3 years ago
6

Write a complete C program to run on the MSP432 platform to do the following:

Computers and Technology
1 answer:
Butoxors [25]3 years ago
8 0

Answer:

The C code is given below with appropriate comments

Explanation:

#include <stdio.h>

int main()

{

//array declaration

int arr[3][7], cumulativeSum = 0;

 

//initialize the array

for(int i=0; i<3; i++)

{

for(int j=0; j<7; j++)

{

arr[i][j] = i+j;

}

}

//calculate the cumulative sum

for(int i=0; i<3; i++)

{

for(int j=0; j<7; j++)

{

if((arr[i][j] % 5) != 0)

{

cumulativeSum += arr[i][j];

arr[i][j] = 0;

}

}

}

 

//display the final array

printf("The final array is: \n\n");

for(int i=0; i<3; i++)

{

for(int j=0; j<7; j++)

{

printf("%d ", arr[i][j]);

}

printf("\n");

}

 

//display the cumulative sum

printf("\nCumulative Sum = %d", cumulativeSum);

return 0;

}

You might be interested in
Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g
I am Lyosha [343]

Answer:

#program in Python.

#function to calculate driving cost

def driving_cost(d_miles, m_per_gallon, doll_per_gallon):

   #calculate cost and return the value

   return (d_miles / m_per_gallon) * doll_per_gallon

#read the miles per gallon  

m_per_gallon = float(input("Enter car's miles/gallon:"))

#read dollars per gallon

doll_per_gallon = float(input("Enter gas dollars/gallon:"))

#call function to find cost for 10 miles

print('%0.2f' % driving_cost(10, m_per_gallon, doll_per_gallon))

#call function to find cost for 50 miles

print('%0.2f' % driving_cost(50, m_per_gallon, doll_per_gallon))

#call function to find cost for 400 miles

print('%0.2f' % driving_cost(400, m_per_gallon, doll_per_gallon))

Explanation:

Read the value of miles per gallon and assign it to variable "m_per_gallon". Then read dollars per gallon from user and assign it to variable "doll_per_gallon". Call the function driving_cost() with parameter miles, m_per_gallon and doll_per_gallon. This function will find the cost of driving and return the cost.Call function for  10, 50 and 400 miles.

Output:

Enter car's miles/gallon:20                                                                                                

Enter gas dollars/gallon:3.1599                                                                                            

1.58                                                                                                                      

7.90                                                                                                                      

63.20

5 0
3 years ago
Read 2 more answers
Which term describes an event where a person who does not have the required clearance or access caveats comes into possession of
notka56 [123]

Answer:

The answer is "compromise"

Explanation:

In computer science, the comprised system is used to describe as any technological resource, that has been negatively affected by an untrustworthy source for nondisclosure, integrity or accessibility either deliberately or inadvertently.

  • In this, the mechanical interaction from the unauthorized source or technological progress can result in compromise.
  • This helps you and the partner to meet each other's interests by taking into consideration both the positions and the solution to the main problem.

4 0
3 years ago
Read 2 more answers
Who said "BAM WHAT?!" On disney channel?
Yuki888 [10]
Maddie from Liv and Maddie 
4 0
3 years ago
Read 2 more answers
Dragging a mouse over text is called
Fantom [35]

Answer:

typing

Explanation:

8 0
3 years ago
Assign sub_lyric by slicing rhyme_lyric from start_index to end_index which are given as inputs. Sample output with inputs: 4 7
N76 [4]

sub_lyric = rhyme_lyric[start_index:end_index]

8 0
4 years ago
Other questions:
  • Apps are A. small, downloadable software programs that can run on tablet devices or smartphones. B. programs that can be used to
    11·1 answer
  • Which Command Prompt commands in Windows is used for listing a computer connections to shared resources
    10·1 answer
  • Blood alcohol level is the ratio between the alcohol consumed and the blood in the body
    10·1 answer
  • Write qbasic code for given pattern<br><br>NEPAL<br>. EPA<br>. P​
    12·1 answer
  • What is this effect in photoshop or photography?
    12·2 answers
  • What type of data is not defined and does not follow a specified format and is typically free-form text such as emails, Twitter
    13·1 answer
  • What feature of virtualization software allows you to revert to a previous point in time in the event you make an unrecoverable
    9·1 answer
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • List the steps you took to configure SERVERC and take a screen shot of the Connect to DNS Server dialog box by pressing Alt+Prt
    11·1 answer
  • Any one have a snnaap chhhaatt if so i need help with something n there
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!