Lists and Procedures Pseudocode Practice For each situation, provide a pseudocoded algorithm that would accomplish the task. Make sure to indent where appropriate. Situation A Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint: use Mod). Displays the sum. Situation B Write a procedure that takes

Answers

Answer 1

Answer:

The pseudocoded algorithm is as follows:

Procedure sumOdd(lotsOfNumbers):

    oddSum = 0

    len = length(lotsOfNumbers)

    for i = 0 to len - 1

         if lotsOfNumbers[i] Mod 2 != 0:

              OddSum = OddSum + lotsOfNumbers[i]

Print(OddSum)

Explanation:

This defines the procedure

Procedure sumOdd(lotsOfNumbers):

This initializes the oddSum to 0

    oddSum = 0

This calculates the length of the list

    len = length(lotsOfNumbers)

This iterates through the list

    for i = 0 to len-1

This checks if current list item is odd

         if lotsOfNumbers[i] Mod 2 != 0:

If yes, the number is added to OddSum

              OddSum = OddSum + lotsOfNumbers[i]

This prints the calculated sum

Print(OddSum)


Related Questions

Which three of the following statements are true about using a WYSIWYG editor?

1.You can preview the web page you’re creating, but it might appear very differently in a web browser.
2.After creating a web page, you need to inspect the code the editor generates for correctness.
3.You can write your own HTML code to create a web page.
4.You can modify the HTML code the editor generates.
5.You don’t need any knowledge of HTML to be able to create a web page.

Answers

Answer:

3

Explanation:

Answer:

The answer is

You can write your own HTML code to create a web page.You can modify the HTML code the editor generates.You don’t need any knowledge of HTML to be able to create a web page.

Explanation:

Plato 5/5

If name is a String instance variable, average is a double instance variable, and numOfStudents is a static int variable, why won’t the following code from a class compile?public Student(String s) {name = s;average = getAverage(name);numOfStudents++;}public double getAverage(String x) {numOfStudents++;double ave = StudentDB.getAverage(x);return ave;}public static void setAverage(double g) {average = g;}a.The setAverage() method can’t access the average instance variable.b.The getAverage() method can’t increment the numOfStudents variable.c.The constructor can’t increment the numOfStudents variable.d.The getAverage() method can’t call a static method in the StudentDB class.

Answers

Answer:

a.

Explanation:

Based solely on the snippet of code provided on the question the main reason why the code won't compile (from the options provided) is that the setAverage() method can’t access the average instance variable. Since the average variable is an instance variable it means that it only exists inside the one of the functions and not to the entire class. Meaning that in this scenario it can only be accessed by the Student function and once that function finishes it no longer exists. Also, it is not one of the options but if these variables are instance variables as mentioned their type needs to be defined inside the function.

reasons why you should add green computing:

Answers

Answer:

Green Computing aims to reduce the carbon footprint generated by the information systems business while allowing them to save money. Today there is a great need to implement the concept of Green computing to save our environment. About 60-70 percent energy ON and that consumed energy is the main reason of co2 emission

Explanation:

Hope it helps!

If you dont mind can you please mark me as brainlest?

what does the
command do

Answers

Please specify your question.

Can someone explain to me the process of inserting fonts into pdf, please? Also, related to this topic, metadata about a font that is stored directly in pdf as pdf objects, what does that mean more precisely? Any help is welcome :)

Answers

Answer:

what is inserting fonts into pdf:Font embedding is the inclusion of font files inside an electronic document. Font embedding is controversial because it allows licensed fonts to be freely distributed.

By using your own data, search engines and other sites try to make your web experience more personalized. However, by doing this, certain information is being hidden from you. Which of the following terms is used to describe the virtual environment a person ends up in when sites choose to show them only certain, customized information?

A filter bubble

A clustered circle

A relational table

An indexed environment

Answers

I believe it is a filter bubble

Answer:

A filter bubble

Explanation:

What is digital transformation?

Answers

Answer:Digital Transformation is the adoption of digital technology to transform services or businesses, through replacing non-digital or manual processes with digital processes or replacing older digital technology with newer digital technology

Explanation:

Answer:

Explanation:

Digital transformation is the process of using digital technologies to transform existing traditional and non-digital business processes and services, or creating new ones, to meet with the evolving market and customer expectations, thus completely altering the way businesses are managed and operated, and how value is delivered to customers

Input 3 positive integers from the terminal, determine if tlrey are valid sides of a triangle. If the sides do form a valid triangle, output the type of triangle - equilateral, isosceles, or scalene - and the area of the triangle. If the three integers are not the valid sides of a triangle, output an appropriats message and the 3 sides. Be sure to comment and error check in your progam.

Answers

Answer:

In Python:

side1 = float(input("Side 1: "))

side2 = float(input("Side 2: "))

side3 = float(input("Side 3: "))

if side1>0 and side2>0 and side3>0:

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

       if side1 == side2 == side3:

           print("Equilateral Triangle")

       elif side1 == side2 or side1 == side3 or side2 == side3:

           print("Isosceles Triangle")

       else:

           print("Scalene Triangle")

   else:

       print("Invalid Triangle")

else:

   print("Invalid Triangle")

Explanation:

The next three lines get the input of the sides of the triangle

side1 = float(input("Side 1: "))

side2 = float(input("Side 2: "))

side3 = float(input("Side 3: "))

If all sides are positive

if side1>0 and side2>0 and side3>0:

Check if the sides are valid using the following condition

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

Check if the triangle is equilateral

       if side1 == side2 == side3:

           print("Equilateral Triangle")

Check if the triangle is isosceles

       elif side1 == side2 or side1 == side3 or side2 == side3:

           print("Isosceles Triangle")

Otherwise, it is scalene

       else:

           print("Scalene Triangle")

Print invalid, if the sides do not make a valid triangle

   else:

       print("Invalid Triangle")

Print invalid, if the any of the sides are negative

else:

   print("Invalid Triangle")

In C++
Write a simple program to test your Circle class. The program must call every member function at least once. The program can do anything of your choice.

Answers

Answer:

int main() {

   Circle* pCircle = new Circle(5.0f, 2, 3);

   pCircle->up();

   pCircle->down();

   pCircle->left();

   pCircle->right();

   cout << "X: " << pCircle->getx() << endl;

   cout << "Y: " << pCircle->gety() << endl;

   cout << "Radius: " << pCircle->getRadius() << endl;

   pCircle->print();

   pCircle->update_radius(4.0f);

   if (pCircle->isUnit()) {

       cout << "is unit" << endl;

   }

   pCircle->move_x(10);

   pCircle->move_y(10);

}

Explanation:

something like that?

Computer programming 2

Answers

Here is the second photo

How are BGP neighbor relationships formed?
1-Automatically through BGP
2-Automatically through EIGRP
3-Automatically through OSPF
4-They are setup manually

Answers

Answer:

4-They are setup manually

Explanation:

BGP neighbor relationships formed "They are set up manually."

This is evident in the fact that BGP creates a nearby adjacency with other BGP routers, this BGP neighbor is then configured manually using TCP port 179 for the actual connection, which is then followed up through the exchange of any routing information.

For BGP neighbors relationship to form it passes through different stages, which are:

1. Idle

2. Connect

3. Active

4. OpenSent

5. OpenConfirm

6. Established

1) primary storage is stored externally (true or false)

2) one function of storage is to store program and data for later use(true or false)
correct answer only i will mark u as brainliest and i will give u 5 star rating if ur answer will correct​

Answers

Answer:

1.true

2.true

Ok will wait my rate ok❤️

what is the process of smaw welding​

Answers

Answer: Manual metal arc welding (MMA or MMAW), also known as shielded metal arc welding (SMAW), flux shielded arc welding or stick welding, is a process where the arc is struck between an electrode flux coated metal rod and the work piece. Both the rod and the surface of the work piece melt to create a weld.

Explanation:

Write a script that will calculate a person’s weight on each planet of the solar system, the sun, and the moon. You should create an html form with text boxes for each planet (also the sun and moon). You should also have a text box for a person to enter their weight on Earth. When the user clicks on a button, a javascript function should be called that calculates each weight and puts the results in the corresponding text boxes in the form. Use the Math.round method to round the numbers to the nearest whole number. Here are some formulas for the conversions.

Mercury= weight * .378
Venus = weight * .907
Mars = weight * .377
Jupiter = weight * 2.364
Saturn = weight * .916
Uranus = weight * .889
Neptune = weight * 1.125
Pluto = weight * .067
Sun = weight * 27.072
Moon = weight * .166

Answers

Answer:

to.use his you should use qbasic and type as it os at last press f5 to see ans

Overheating of a computer can be easily prevented. Explain how​

Answers

Here are a few examples:

•] Keep away from windows or vents to prevent it from turning warm.

•] Clean off dust that’s on the computer.

•] Remove all the things that are blocking air to pass to let it cool down.

•] Putting a soft item below the computer is a action that is prohibited as it blocks the airways which causes it to overheat instead put it on a sturdy flat surface to prevent the aforementioned information.

•] To never overcharge your computer too 100% overnight or any time of the day since it overheats and causes battery life to be short, instead put it to charge when you’re conscious while keeping an eye on it, perhaps set a timer/alarm to notify you if you forget.

The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as a value returning function, returning the required item. If the location of the item to be returned is out of range, use the assert function to terminate the program. Also, write a program to test your function. Use the class unorderedArrayListType to test your function.

Answers

Answer:

int retrieveAt(int location, array){

   // Function to retrieve the element from the list at the position

   // specified by the location

   if (location <= array.size() - 1){

       return array[location];

   } else{

       cout<<"Location out of range";

       assert(); // Assuming the assert function is defined in the program.

   }

}

Explanation:

The void retrieveAt function is converted to a return function that returns the integer item of the array given the location and the array variable as arguments. The assert function is used to terminate the program.

Can you please provide sample rexx code?

Answers

Answer:

/*  My first REXX program  */

say 'Hello world'

Explanation:

REXX is an OS/2 scripting language.

Define a function below, count_over_100, which takes a list of numbers as an argument. Complete the function to count how many of the numbers in the list are greater than 100. The recommended approach for this: (1) create a variable to hold the current count and initialize it to zero, (2) use a for loop to process each element of the list, adding one to your current count if it fits the criteria, (3) return the count at the end.

Answers

Answer:

In Python:

def count_over_100(mylist):

   kount = 0

   for i in range(len(mylist)):

       if mylist[i] > 100:

           kount+=1

   return kount

Explanation:

This defines the function

def count_over_100(mylist):

(1) This initializes kount to 0

   kount = 0

(2) This iterates through the loop

   for i in range(len(mylist)):

If current list element is greater tha 100, kount is incremented by 1

       if mylist[i] > 100:

           kount+=1

This returns kount

   return kount

Write a program that will input miles traveled and hours spent in travel. The program will determine miles per hour. This calculation must be done in a function other than main; however, main will print the calculation. The function will thus have 3 parameters: miles, hours, and milesPerHour. Which parameter(s) are pass by value and which are passed by reference

Answers

def calculations(miles, hours):
milesPerHour = miles / hours
return milesPerHour

def main():
miles = input("Enter Miles driven: ")
hours = input("Enter Travel Hours: ")
print(calculations(miles, hours))

if __name__=='__main__':
main()

Which of the following cannot be used in MS Office.
Joystick
Scanner
Light Pen
Mouse

Answers

Answer:

A.

Explanation:

A Joystick is a control device that is connected to the computer to play games. A joystick is similar in structure to a control stick used by pilots in airplanes and got its name from the same. A joystick contains a stick, base, extra buttons, auto switch fire, trigger, throttle, POV hat, and a suction cup. A joystick also serves the purpose of assistive technology.

The device which can not be used in MS Office is a joystick. Therefore, option A is correct.

Write a program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 50 temperatures. Use typedef to declare the array type. The average should be displayed to two decimal places

Answers

Answer:

#include <iostream>  

using namespace std;

typedef double* temperatures;

double avg(array t, int length);

double min(array t, int length);

double max(array t, int length);

int main()

{

   cout << "Please input the number of temperatures to be read." << endl;

   int num;

   cin >> num;

   temperatures = new double[num];

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

   {

       cout << "Input temperature " << (i+1) << ":" << endl;

       cin >> temperatures[i];

   }

   cout << "The average temperature is " << avg(temperatures, num) << endl;

   cout << "The highest temperature is " << max(temperatures, num) << endl;

   cout << "The lowest temperature is " << min(temperatures, num) << endl;

}

double avg(array t, int length)

{

   double sum = 0.0;

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

       sum += t[i];

   return sum/length;

}

double min(array t, int length)

{

   if(length == 0)

       return 0;

    double min = t[0];

   for(int i = 1; i < length; i++)

       if(t[i] < min)

           min = t[i];

   return min;

}

double max(array t, int length)

{

   if(length == 0)

       return 0;

      double max = t[0];

   for(int i = 1; i < length; i++)

       if(t[i] > min)

           max = t[i];

   return max;

}

Explanation:

The C++ program get the array of temperatures not more than 50 items and displays the mean, minimum and maximum values of the temperature array.

Which are the two alternatives for pasting copied data in a target cell or a group of cells?
You can right-click the target cell or cells and then select the ___
option or press the ___
keys to paste the copied data.

Answers

Answer:

first blank: paste

2nd blank: ctrl + v

Explanation:

those ways are just how you do it anywhere.

Suppose you design a banking application. The class CheckingAccount already exists and implements interface Account. Another class that implements the Account interface is CreditAccount. When the user calls creditAccount.withdraw(amount) it actually makes a loan from the bank. Now you have to write the class OverdraftCheckingAccount, that also implements Account and that provides overdraft protection, meaning that if overdraftCheckingAccount.withdraw(amount) brings the balance below 0, it will actually withdraw the difference from a CreditAccount linked to the OverdraftCheckingAccount object. What design pattern is appropriate in this case for implementing the OverdraftCheckingAccount class

Answers

Answer:

Strategy

Explanation:

The strategic design pattern is defined as the behavioral design pattern that enables the selecting of a algorithm for the runtime. Here the code receives a run-time instructions regarding the family of the algorithms to be used.

In the context, the strategic pattern is used for the application for implementing OverdraftCheckingAccount class. And the main aspect of this strategic pattern  is the reusability of the code. It is behavioral pattern.

describe the major elements and issues with agile development​

Answers

Answer:

water

Explanation:

progresses through overtime

discuss advantages and disadvantages of os

Answers

Answer:

Advantages :

Management of hardware and software

easy to use with GUI

Convenient and easy to use different applications on the system.

Disadvantages:

They are expensive to buy

There can be technical issues which can ruin the task

Data can be lost if not saved properly

Explanation:

Operating system is a software which manages the computer. It efficiently manages the timelines and data stored on it is considered as safe by placing passwords. There are various advantages and disadvantages of the system. It is dependent on the user how he uses the software.

which of the following is correct statement ? A
. a set of instructions is called program
B.computers can be used for diagnosing the difficulty of a student in learning a subject . C. psychological testing can be done with the help of computer provided software is available. D. all of the above

Answers

Answer:

D all of the above

Explanation:

because a computer performs all the above_mentioned tasks

All of the above options are  correct statement. Check more about program below.

What is program?

A program is regarded as some set of compositions of instructions or codes that a computer needs to follows so as to carry out a specific work.

Conclusively, the correct statement are:

A set of instructions is called program,Computers can be used for diagnosing the difficulty of a student in learning a subject. Psychological testing can be done with the help of computer provided software is available.

Learn more about program from

https://brainly.com/question/1538272

How many GPRs (General purpose registers) are in ATMEGA?

Answers

Answer:

There are 32 general-purpose 8-bit registers, RO-R31 All arithmetic and logic operations operate on those registers; only load and store instructions access RAM. A limited number of instructions operate on 16-bit register pairs.

Computer programming 4

Answers

The second output photo

identify the following​

Answers

Answer:

attachment sign

Explanation:

that is the attachment sign.

how to view a pivate acont on Intagam​

Answers

You can just make a new account and pretend your someone else and send them a request :)
Other Questions
Whom did Radha tell about her plans? (12 - 8)3 24 x 2Plz help me How do you think the story of jungle book will end? Dr. Yuan opens a lab. The lab has an initial cost of $100,000. Expected net cash flow is $24,000 in the first year, growing by 15% per year. Net cash flow is revenue less expenses. Assume the lab has a 6 yr life and there is no scrap value for the lab.Later that same year, Dr. Bhat opens a similar lab in the strip mall less than two miles away from Dr. Yuan. Dr. Yuan estimates her net cash flow in the first year will be considerably less than her initial estimate. She estimates it will be $16,000. All else equal, what happens to the NPV of Dr. Yuans lab?a) The NPV decreases, but is still positive. Dr. Yuan can still expect a positive return on her investment.b) The IRR decreases, but is still positive. Dr. Yuan can still expect a positive return on her investment.c) The IRR decreases, and becomes negative. Dr. Yuan should expect a loss on this investment.d) The IRR and the NPV decrease. Dr. Yuan can still expect a positive return on her investment.Assume instead that Dr. Yuan forms a partnership with Dr. Bhat. They agree to share the $100,000 cost equally and to share the cash flow equally. Because of efficiency gains from longer operating hours, they expect the net cash flow to be $32,000 per year. Assume they expect net cash flow to grow at 15% per year. What is the consequence of the partnership to Dr. Yuan? Please compare the results to the original scenario described in question 13 (Dr. Yan opening the only lab in the area).a) The NPV decreases, but is still positive. Dr. Yuan can still expect a positive return on her investment.b) The NPV decreases, and becomes negative. Dr. Yuan should expect a loss on this investment.c) The IRR decreases, but is still positive. Dr. Yuan can still expect a positive return on her investment.d) The IRR and the NPV increase. Dr. Yuan can still expect a positive return on her investment To democratize knowledge means that:A. people decide what information is important to release to thepublic.B. everyone has a right to own and use electronic devices andcomputers.O c. people have equal access to knowledge and can contribute to it aswell.O D. everyone can vote and take part in deciding what knowledge isshared. Imagine you were an animal that lived in the tundra. What are three adaptations that would help you survive by either finding food or avoiding being eaten? Ivanhoe Company reports the following operating results for the month of August: sales $392,000 (units 4,900), variable costs $247,000, and fixed costs $96,000. Management is considering the following independent courses of action to increase net income. 1. Increase selling price by 10% with no change in total variable costs or units sold. 2. Reduce variable costs to 57% of sales.3. Reduce fixed costs by $22,000. Which course of action wiIl produce the highest net? how many integers satisfy the inequality? What instrument makes the slowest vibration? A drum? A whistle? A flute? Or a harmonica? The shape of a talk bubble can be used to add emphasis to the text inside it, suggesting the way in which a character might be speaking.TrueFalse Mention any two function of Iron. Find the measures of the numbered angles A rectangle is 14 inches long and 6 inches wide. Find its area. A 78 square inches B 20 square inches C 84 square inches D 26 square inches What is the area of this figure? Enter your answer in the box. ___in^2 Solid iron pellets are heated, melted and drawn into wires. This is an example of a chemical reaction.O TrueO False PLEASE HELP!!How would you characterize FDRs approach to the Great Depression? Chemco Enterprises is the manufacturer of Ultra-Dry, a hydrophobic coating that will waterproof anything. Over a 5-year period, the costs associ-ated with the pilot test product line were as fol-lows: first cost of $30,000 and annual costs of $18,000. Annual revenue was $27,000 and used equipment was salvaged for $4000. What rate of return did the company make on this product if your heat beats 75times per minute how many time does it beat in 5 hours Please Answer Before 1:30 pm!!!! Hurry!!!!!! What type of government does the United States have?What affects a country's standard of living? What determines the value of currencies? Help.. how do I stop being scared of things like strong gusts of wind and wood screeching at night.Right now, I'm trying to do homework, and it's like midnight, and it's quite scary.