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
Likurg_2 [28]
4 years ago
14

Write a function negateOdds that takes a list of integers and returns a list of integers with all of the odd integers negated. n

egateOdds :: [Integer] -> [Integer]
example: [1,2,3,4,5] should return [-1,2,-3,4,-5]
Computers and Technology
1 answer:
aleksley [76]4 years ago
5 0

Is this computer science?

If so, then the function you would need for your code is this...

_____

if (someValue%2 != 0) {

 value *= -1;

        }

_____

//basically <u>number%2 == 0</u> means even so "!" means false so "not even" meaning "odd."

Assuming you are doing an array list (given a set value) or a for-loop with an

int someValue = Integer.parseInt(args[i]); inside (not given a set value and not restricted)

Otherwise ignore me....lol

You might be interested in
If you delete a conversation many times with someone like this, will you stop receiving messages from them?
GREYUIT [131]

Answer: No

Explanation:

4 0
3 years ago
The computer-like model used to describe the way humans encode, store, and retrieve information is the ________ model.
FinnZ [79.3K]

Answer:

Information processing model

<em>Hope it helps!</em>

3 0
2 years ago
Given that note, write a program which tells us the major scale starting at that note, using the pattern above. In the main bloc
White raven [17]

<u>Solution and Explanation:</u>

the_notes = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B'] #original list

def get_scale(choice): #function to get the major diatonic scale

steps=[1,1,.5,1,1,1,.5] #separate list for steps

size=None

for i in range(0,12): #loop to find out the index of the note entered

if(the_notes[i]==choice):

size =i

break

new_notes=the_notes[size:] + the_notes[:size]

#the above statement rotate the list so that the entered note can become the first note in the new list(i.e new notes)

index =0 #

scale="" #a string to store the major diatonic scale

for i in range(0,7):

scale+=new_notes[index]+" "

if(steps[i]==1):

index = index+2

else:

index=index+1

return scale

#main block

while(1):

choice=input("What scale do you want or Q to quit? ")

if(choice=='Q'):

break

elif(choice in the_notes):

print(get_scale(choice))

else:

print("That is not a note")

5 0
3 years ago
What is does the word multimedia mean?
Natasha_Volkova [10]
Your answer would be B. Media that combines text, images, animation, and sound.
You're welcome:)
3 0
3 years ago
Read 2 more answers
Write a java program that accepts the ingredients for a recipe in cups and converts to ounces
Tanzania [10]

Answer:

Explanation:

public static int cupsToOunces (int cups) {

   

       int ounces = cups * 8;

       return ounces;

       

   }

This is a very simple Java method that takes in the number of cups in the recipe as a parameter, converts it to ounces, and then returns the number of ounces. It is very simple since 1 cup is equal to 8 ounces, therefore it simply takes the cups and multiplies it by 8 and saves that value in an int variable called ounces.

6 0
3 years ago
Other questions:
  • What are some differences between film and digital cameras?
    8·1 answer
  • What is the different between 32bit anf 64 bit verision​
    11·1 answer
  • What term identifies the physical interface between a computer and its peripherals?
    5·1 answer
  • How are the monsters related to humans
    5·1 answer
  • How many characters should a strong password have? four six eight ten
    10·2 answers
  • Drow flowchart that finds a<br> series between 10, 100<br> fibonanchi
    6·1 answer
  • Where do animators work?
    6·1 answer
  • Why do you think it is important to know typography and color when designing web sites?
    15·2 answers
  • The term for an operator that may not evaluate one of its subexpressions is
    14·1 answer
  • What is the purpose of secondary<br> memory?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!