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
There is always this thing that comes out and I can't answer one's question. How do I undo this?
Y_Kistochka [10]
You should enter your email address
8 0
3 years ago
Read 2 more answers
What is one purpose of an algorithm
adelina 88 [10]

Answer:

Algorithms is formula for solving a problem. It is helpful because it specifically give instructions detail to computer to what a computer should perform a specific task.

For e.g. calculating report cards.

4 0
3 years ago
What is mean by sole trading concern?​
DENIUS [597]

Answer:

trading as a whole

Explanation:

pls give brainlest almost lvled up.

6 0
3 years ago
PLEASE HELP<br><br><br> Write a pseudo code for an algorithm to wrap a gift.
Thepotemich [5.8K]

in computertional geometry the gift wrapping algorithm is an algorithm for computing the context hull of a given set of points

4 0
2 years ago
ad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (an
WINSTONCH [101]

Answer:

Python

name =input("")  #input name

location = input("")  #input location

number = int(input(""))  #input number

pluralNoun = input("")  #input plural noun

print(name, 'went to', location, 'to buy', number, 'different types of', pluralNoun) #prints the short story using input variables

JAVA:

import java.util.Scanner;   // to accept input from user

public class Main {  

public static void main(String[] args) {  //start of main function

  Scanner input = new Scanner (System.in) ; //creates Scanner class object

   String subject;  //declares string type variable to hold name

   String location;  //declares string type variable to hold location

   int number;  //declares int type variable to hold number

   String object;  //declares string type variable to hold plural noun

  subject = input.next();  //reads input subject string value

  location = input.next();  //reads input location string value

  number = input.nextInt();  //reads input number integer value

  object = input.next();  //reads input object string value

  System.out.println(subject + " went to " + location + " to buy " + number + " different types of " + object + "."); } } //prints the short story using input values and existing string added with input values

In C++

#include <iostream> //to use input output functions

using namespace std; //to identify objects like cin cout

int main(){ //start of main function

   string first_name; // string variable that holds the first_name value

   cin>>first_name; //reads the first_name from user

   string generic_location; // string variable that holds the generic location

   cin>>generic_location; //reads the generic location  from user

   int whole_number; // int variable that holds the whole_number value

   cin>>whole_number; //reads the whole number  from user

   string plural_noun; // string variable that holds the plural_noun value

   cin>>plural_noun; //reads the plural_noun from user

cout<<first_name<<" went to "<< generic_location<<" to buy "<< whole_number<<" different types of "<<plural_noun;} //prints the short story using input values and existing string added with input values

Explanation:

The complete statement is:

If the input is:

Ex: If the input is

Eric

Chipotle

12

cars

Then the output is:  

Eric went to Chipotle to buy 12 different types of cars

Now to complete this program we read the needed values from input, that the existing output statements can use to output a short story.

If you look at the input Eric which is a name can be used as an input value as the name can be different for different users. Chipotle is a location that should aslo be an input value because locations can vary too of different users. 12 is a numeric that can also vary. For example a person can have more than or less than 12 cars. Lastly, cars which is  plural noun can also be used as input value. Now to get the above output we concatenated the input variables with the strings in the print statement in order to output a short story.

You can name the variables whatever you like as i have used different variable names in different programs.

4 0
3 years ago
Other questions:
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    5·1 answer
  • Which player type focuses on level progression?
    13·1 answer
  • Wireless networks are the most difficult type of network to set up <br> true or false
    15·1 answer
  • Antiglare screens are sometimes called ____.
    7·1 answer
  • In what year was google launched on the web?
    14·1 answer
  • Science can give us
    5·2 answers
  • The administrators of Tiny College are so pleased with your design and implementation of their student registra- tion and tracki
    13·1 answer
  • Ok so I usually don’t do this but I just need an answer , on Instagram a notification popped up while I was watching someone’s s
    9·2 answers
  • Brody is concerned that he is going to exceed the quota set for his mailbox. Where should he go to access the Mailbe
    10·1 answer
  • One limitation of high-level programming languages is
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!